Basic Linux Tutorial
Introduction – What is it? Why to learn? Linux installation directory structures Boot process Run levels in Linux Desktop Environments Different shells BASH Internal and External Commands Basic Linux Commands Important files and directories in Linux Environmental and Shell Variables Command history in Linux Character classes in Linux Text editors vim nano Searching files Creating new files Viewing File Contents File commands File permissions and ownership WildCards (Globbing) in files File compression Directory commands xargs command in Linux Comparing files Searching patterns using grep command Translating the characters using tr command Extracting data using cut command Stream editing using sed command Data extraction and reporting using awk command Sorting the file or string input uniq command in Linux Difference between grep, tr, cut, sed and awk commands Hardware commands Hard disk and memory space commands Working with Processes Managing Jobs Working with cron jobs Service command in Linux Network commands Managing Users and Groups Other Popular commands Standard streams and Redirection Pipes Package Managers in LinuxPipes in linux shell
Pipe is a very important concept in Linux. With the help of Pipes, output from one command can be used as an input as the other command. For example – Consider a scenario wherein you want to view all files whose name starts with letter s in sorted order. We can accomplish this task using 2 commands as shown below.- Find files starting with s.
- Sort the list.
$find -name ‘s*’ | sort
Explanation – find command generates the list of files matching given conditions. The output of the command is displayed on the standard output i.e console. But in above case, since we have used pipe (|), output of the command is sent as input to the sort command. Another example – Let us say you want to number each line in the file. Then you can use below command to do it.
cat abc.txt | nl
xargs and pipes
xargs is very handy command to work on multiple files. It is usually used along with pipes.Web development and Automation testing
solutions delivered!!