GoConqr has a new look! Let us know what you think.

Mind map

Shell Utilities

Jose Noe Vazquez Gutierrez . LINUX English

Map content

Shell Utilities

  1. 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)
    • 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
    • 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)
    • 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)
    • 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)
    • 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

Information

Description
LINUX Mind Map on Shell Utilities, created by Jose Noe Vazquez Gutierrez . on 21/01/2018.
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?