pwd – print working directory, or what directory am I in?
The user is in the root directory
ls – list directory contents, or what is in this directory?
cd – change directory
man – show the manual page for a command, or what does this command do?
This will show information about the list directory contents command.
touch – create a text file
This would create a text file imaginatively titled ‘textfile’
cat – concatenate – I have only ever used this command to view files that I have created
This would display the contents of the textfile in the command line.
mkdir – create a directory
This would create a folder or directory inside the current folder of marc
cp – copy a file, copies a file from one location to another
cp /Documents/textfile /Documents/marc/textfile
This will copy the text file from the Documents folder and place the copy in the /Documents/Marc folder.
mv – move a file, instead of copying a file, this will mv will move the file. Interestingly this can be used to rename files as well:
mv textfile differentName
Here is a screenshot of all the above commands in use:
rm – remove
This would delete the textfile.
echo – display a line of text
The above command displays and reveals an unfortunate truth.
To use echo to place text inside a text file:
echo Marc is going on a diet > differentname
The following screenshot shows the echo command placing the text that follows to the differentname text file that was created earlier. Take note that I made sure that I was currently in the marc directory that was created earlier.
To add text to that file you must use the >> arrows. If you you use one arrow > you will replace the text.
> create or replace text in file
>> add or append to the text already in the file
See the following screenshot for more information
ifconfig – this will tell you what your IP address is.
service network-manager restart – this will allow you to reboot your netwroking if you have swapped from bridged to host only networking and you want your kali installation to pick up the new IP address.
apt-get update && apt-get upgrade – this will allow to retrieve the available list of updates, and then once that is done the perform the upgrades.
apt-get dist-upgrade – this will perform a distribution upgrade, only execute this after performing update, and upgrade above.
apt-get autoclean – automatically clean up files that are no longer of any use.
2 thoughts on “Basic Linux Terminal Commands”
Thanks for sharing. I’ve written on the same topic here: shttps://www.bhutanio.com/15-basic-unix-commands-one-must-know/