linux command | linux command cheat sheet

File Management
  • ls – List files and folders
  • cd – Change directory
  • pwd – Present working directory
  • mkdir – Make a new empty directory
  • rmdir – Remove an empty directory
  • cp – Copy files or directory
  • rm – Remove files or directory
  • mv – Move files or directory / Rename files or directory
  • find – Find files or folders bases on name, data, size, owner or other parameters
  • touch – make a new blank files
Permissions
  • chown – Change ownership of files / directories
  • chgrp – Change group ownership of files / directories
  • chmod – Change permission of files / directories
  • groups – Reports the groups you belong to
  • id – Reports your username, user-id, group(s) and groupid(s)
Resource Monitoring
  • w – See who logged in on your system and what they are doing.
  • who – See who logged in on which shell and time.
  • uname – display the system information like(machine name, version, hostname).
  • hostname – display your system hostname.
  • top – See the top resource hungry processes.
  • ps – Process schedule / status.
  • df – See how much disk space is free.
  • du – Report numbers and size of files on disk.
Printing
  • lpr – send text or post script files to the printer.
  • lpq – view the print queue.
  • lprm – Remove your print jobs.
Job Control
  • whereis – Display full path and installation path of commands.
  • which – Display the full path of commands.
  • ctrl+z – Suspend the current job
  • bg – Put a suspended job in the background.
  • fg – Bring a suspended job into the foreground.
  • kill – Kill a process
Filtering/Searching
  • grep – Search for sub strings in a file or pipeline.
  • awk – Pattern searching in a folder or within a file.
  • sed – Sed is a Stream Editor used for modifying the files in unix (or linux). Whenever you want to make changes to the file automatically.
  • sort – Sort lines alphabetically or numerically.
  • wc – Count lines, word and characters.
  • cat – Catalog a file.
  • more – Teminal bases text viewing program.
 

Find matching files and folder and rename it 

find . -name “clientlib_*” | awk ‘{print(“mv “$1 ” ” $1)}’ | sed ‘s/clientlib_//2’ | sh