• Home
  • Linux Advanced Functions And Commands

Linux Advanced Functions And Commands

  • (4.0)
  • | 3276 Ratings

Linux Advanced Functions And Commands

Using the shell features as discussed in MOVING FILES, we had looked at using the shell feature to manipulate multiple files in one instance. In the example, the shell automatically found out what the user meant by the requirements between the square braces “[” “]”. Coincidentally, the shell can substitute a range of numbers, lower and upper case characters, and as many characters as you want with an asterisk. You can use many substitutions simultaneously because the shell handles these substitutions very logically. For instance, the bash shell finds no problems with expressions such as the ls dirname/*/*/*[2-3]. However, in other shells, we use the asterisk to minimize the efforts of typing. For instance, instead of entering cd directory, you enter cd dir*. In the Bash GNU, this is not necessary because the shell has a feature called file name completion which makes it possible to type the first few characters of a command and the shell finds what you are looking for. For instance, in a directory full of files, you can search for files beginning with the letter A by typing Is A and double pressing the tab key rather than the enter key. Let us have a look at some of the LINUX ADVANCED AND FUNCTIONS AND COMMANDS.

Learn how to use LINUX, from beginner basics to advanced techniques, with online video tutorials taught by industry experts. Enroll for Free LINUX Training Demo!

Looking up files

The simplest way to search for files is by the help of which command to search for directories indexed in the user search path. The path only contains files or directories containing executable files or programs, which makes the “which” command redundant. The “which” command is especially convenient when diagnosing “command not found”.

Let us look at an example where our user “john” cannot use the acroread program, while a colleague of his has no problems with the program on the same system. The colleague tells John that he can see the program in /opt/acroread/bin but the directory is not in the path:


We can solve this problem by commanding the full path to run. Alternatively, we can re-export the content of the variable path:

                                     variable path

Frequently asked Linux Interview Questions

The command (the which command) also checks whether the command is an alias for another command:

gerrit:~> which -a ls
 ls is aliased to `ls -F --color=auto'
 ls is /bin/ls

If the above command does not work,  you can use the alias command

tille@www:~/mail$ alias ls
 alias ls='ls --color'

Finding and locating files

The find tool is the real tool to use when searching for directories that are not in the path. It is a very powerful tool, but most users consider it a somewhat difficult syntax. The GNU find on the other hand handles syntax problems. The command allows you to search file names and access file sizes, dates of change and almost all the other file property changes.

find  -name 

This means look in all subdirectories and files in the specified path and print a list of all the files with a name of the search criteria (string name and not the content), you can use the search command to search for files of a certain size. For example, let us assume our user john wants to find files larger than 5mb:

john:~> find . -size +5000k
Explore Linux Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!


List of Other Linux Courses:

Subscribe For Free Demo

Free Demo for Corporate & Online Trainings.

About The Author

Sandeep is working as a Senior Content Contributor for Mindmajix, one of the world’s leading online learning platforms. With over 5 years of experience in the technology industry, he holds expertise in writing articles on various technologies including AEM, Oracle SOA, Linux, Cybersecurity, and Kubernetes. Follow him on LinkedIn and Twitter. Protection Status