Mindmap
Shell Utilities
Inhalt der Mindmap
Shell Utilities
Linux provides tools, and mechanisms, like the pipe, to put these tools together into useful utilities.
- cat
- cat stands for 'concatenation', cat takes a number of files and display them together
- cat fruits.txt = cat < fruits.txt
- cat fruits.txt vegetables.txt
- cat fruits.txt vegetables.txt >> fruitsAndVegetables.txtx
- cat > myFile.txt (writes data into the file)
- cat stands for 'concatenation', cat takes a number of files and display them together
- head, tail
- These commands are used to viewing large files
- head myFile.txt #displays the first 10 line of the file myFile.txt
- tail myFile.txt #display the last 10 lines of the file myFile.txt
- head -2 myFiles.txt (shows the first 2 lines)
- You can combine the cat and the head/tail commands: cat fruits.txt | head -3
- These commands are used to viewing large files
- more
- The more command to view large files, one page at time.
- On most linux systems, more can also be called 'less'.
- more a_large_file.txt
- man ls | more
- Use PageUp/PageDown or 'f' and 'q' to move forward or back a page, and q to exit the view mode (and 'h' to get help)
- On most linux systems, more can also be called 'less'.
- The more command to view large files, one page at time.
- lpr
- This command is used to send a file to a printer, lpr stands for line printer
- lpr myFile.txt # sends the file myFile.txt to the default printer
- cat another_file.txt | lpr
- lpr < fruits.txt
- lpr -PmyPrinter fruits.txt #sends the file fruits.txt to the printer myPrinter
- lpq
- Displays the queue of the default printer, we can use the -P option to display the job of an specific printer.
- lpq
- lpq -PmyPrinter
- lprm
- Removes a nominated job (use the number in the job column of the lpq output)
- lprm 14 (removes the job 14)
- Removes a nominated job (use the number in the job column of the lpq output)
- Displays the queue of the default printer, we can use the -P option to display the job of an specific printer.
- This command is used to send a file to a printer, lpr stands for line printer
- cut
- Print selected parts of lines from each FILE to standard output (cuts out)
- echo "123abc" | cut -c 3-5 (get the characters from 3 to 5 index: 3ab)
- cut -d " " -f 1 myFile.txt (gets the first field from the file delimited by a space, d=delimiter, f=fields)
- Print selected parts of lines from each FILE to standard output (cuts out)
- tr
- This command is used to translate characters and remove unwanted characters
- echo "abcd" | tr 'a-z' 'A-C' = ABCD
- echo "abcd" | tr -d "aiueo" (deletes all the vowels) = bcd
- echo "abcd" | tr -dc "aiueo\n" (ingnores everything except the vowels and the ENTER) = a
- This command is used to translate characters and remove unwanted characters
- cat
Informationen
- Beschreibung
- LINUX Mindmap am Shell Utilities, erstellt von Jose Noe Vazquez Gutierrez . am 21/01/2018.
- Erstellt von
- Jose Noe Vazquez Gutierrez .
- Aufrufe
- 0
- Bewertung