Mac Tips

Unix commands on Mac Terminal

mac-terminal-unix-commands

Basic Unix Commands to work on Mac terminal:

Most of us sometimes, get a chance to work on Mac terminal, but we may not be familiar with the basic terminal commands to work. In this post, you will find some helpful basic Unix Commands to work on Mac terminal. Let’s have a quick glance of such commands.

The below are the few basic Unix Commands to work on Mac terminal that helps in your day to day life.

pwd :

The “pwd” command displays the pathname of the current directory that you are working on.

ps:-

The “ps” commands lists out running processes.

ls:-
The “ls” command lists out the names of the files in the current working directory.

ls-r:-
The “ls-r” command lists out the names of the files that are readable in the current working directory.

ls-w:-
The “ls-w” command lists out the names of the files that are writable in the current working directory.

cd..:-

The “cd..” command helps to switch one step back to its parent directly level.

cd:-

The “cd” command returns to your home directory.

cd <directoryname> :-

The “cd <directory name> helps to change the working directory to the specified directory name.

mkdir <directoryname> :

The “mkdir <directoryname>” creates a new directory with the name provided.

rmdir <directoryname> :

The “rmdir <directoryname>” removes the specified directory name.

rm <filename>:

The “rm <filename” deletes the specified file.

more <filename>:-

The “more <filename>” displays a text file per page at a time and press space bar to see the next page.

cp <filename1> <filename2>:-

Ithe “cp <filename1> <filename2>” helps to copy data in one file to other.

diff <filename1> <filename2>:-

The “diff <filename1> <filename2>” command helps to compare two files lines by line.

chmod:-

The “chmod” command changes permissions for accessing a file. 

mv  <filename1> <filename2> :-

The “mv <filename1> <filename2>” command moves a file or changes the name of the file to the specified one.

echo <text>:-

The “echo <text>” command repeats the text that was specified next to “echo”.

date:-

The “date” command displays the system current date and time.

help:-

The “help” command displays a certain list of bash commands.

control + c:-

The “Control + c” command helps to terminate the operation that is running on the terminal. These are the few basic Unix Commands to work on Mac terminal.