Linux and all version of unix (including MacOS) have a very rich command line that can be used in many different ways to form very powerful commands. These commands can be joined together to do complex jobs in a very simple way. These are some of the basic commands to get you started.
lsList files in the current directory
ls -lDisplay directory contents in a “long list” format.
ls -lahDisplay all files, including hidden, with a human-readable file size.
cd /var/logChanges location to /var/log
cd ~Changes to your user’s home directory.
cd –Returns you to the previous directory you were working in.
cd ..Moves you one directory up/back in the directory structure.
The cp command copies a file from one place to another, or can create a new copy of a file in the same location with a different name.
cp file.txt newfile.txtCopy file.txt to newfile.txt
cp -r /home/user/pics /home/user2/Recursively (meaning the directory and all of its contents) copy the pics directory from /home/user/ to /home/user2/
mv file.txt /home/user/newuser/Moves the file called file.txt to the directory /home/user/newuser/
mv oldfile.txt newfile.txtRenames the file oldfile.txt to newfile.txt
mkdir filesMakes a new directory called files
rm file.txtDeletes the file called file.txt
rm -r filesDeletes the directory called files along with everything in it
rmdir filesDeletes an empty directory called files
cat file.txtDisplays the entire contents of the file file.txt
The locate - a.k.a. find - command is meant to find a file within the filesystem. If you don't know the name of a certain file or you aren't sure where the file is saved and stored, the locate command comes in handy.
locate -i filenameSearches the filesystem for filename ignoring case
ping - send a packet of data to another network device and time the reply
ping 8.8.8.8Sends a packet to 8.8.8.8 (Google's public DNS server) and waits for the reply
Get instructions for a particular command
man manGet help with the man command
man lsGet help on ls
wDisplays a list of users who are logged in to the system through a remote shell or local terminal, what they are doing, and other relevant information.