- Mac terminal commands list pdf pdf#
- Mac terminal commands list pdf update#
- Mac terminal commands list pdf full#
Mv file1 file2 – Rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2
Mv file /home/ dirname – Move the file called filename to the /home/dirname directory Rm -rf dir – Force remove an entire directory dir and all it’s included files and subdirectories (use with extreme caution)Ĭp -r dir1 dir2 – Copy dir1 to dir2 create dir2 if it doesn't existĬp file /home/ dirname – Copy the filename called file to the /home/dirname directory Rm name – Remove a file or directory called name Ls -al – Formatted listing with hidden files Ls -F – List files in current directory and indicate the file type Ls -laC – List all files in current directory in long format and display in columns Ls -l – List files in current directory using long format Grep TextStringToFind / dir – Starting with the directory called dir, look for and list all files containing TextStringToFindĬhmod octal file – Change the permissions of file to octal, which can be found separately for user, group, and world by adding: 4 – read (r), 2 – write (w), 1 – execute (x)Ĭhmod 755 – rwx for owner, rx for group and world Which filename – Show the subdirectory containing the executable file called filename
Mac terminal commands list pdf update#
Updatedb – Create or update the database of files on all file systems attached to the Linux root directory Locate filename – Find a file called filename using the locate command this assumes you have already used the command updatedb (see next) Grep -r pattern dir – Search recursively for pattern in dirĬommand | grep pattern – Search for pattern in the output of commandįind / -name filename – Starting with the root directory, look for the file called filenameįind / -name ”* filename*” – Starting with the root directory, look for the file containing the string filename Grep pattern files – Search for pattern in files
Mac terminal commands list pdf full#
Which app – Show which app will be run by default it shows the full path Whereis app – Show possible locations of app
Time command – See how long a command takes Which command – Show full path name of command
Mac terminal commands list pdf pdf#
Man -t man | ps2pdf - > man.pdf – Make a pdf of a manual page Man command – Show the manual for command Man -k keyword – Display man pages containing keyword (a period) – Insert the last argument of the previous command on the fly, which enables you to edit it before executing the commandĬtrl + A – Return to the start of the command you're typingĬtrl + E – Go to the end of the command you're typingĬtrl + U – Cut everything before the cursor to a special clipboard, erases the whole lineĬtrl + K – Cut everything after the cursor to a special clipboardĬtrl + Y – Paste from the special clipboard that Ctrl + U and Ctrl + K save their data toĬtrl + T – Swap the two characters before the cursor (you can actually use this to transport a character from the left to the right, try it!)Ĭtrl + W – Delete the word / argument left of the cursor in the current lineĬtrl + D – Log out of current session, similar to exitĪpropos subject – List manual pages for subject Finger user – Display information about userĬtrl + R – Allows you to type a part of the command you're looking for and finds itĬtrl + Z – Stops the current command, resume with fg in the foreground or bg in the backgroundĬtrl + C – Halts the current command, cancel the current operation and/or start with a fresh new lineĬommand | less – Allows the scrolling of the bash command window using Shift + Up Arrow and Shift + Down ArrowĬommand !$ – Repeats the last argument of the previous commandĮsc +.