Linux Commands – Quick Cheat Sheet
Having a quick cheat sheet is quite handy.
Manual
See the manual for command:
man
User
To find the current user:
whoami
To change the password:
passwd
To switch users:
su
To add a user:
adduser
/etc/passwd, /etc/shadow
To run as a sudo admin:
sudo [command]
Directory/File
To find the current working directory:
pwd
To change directory:
cd
cd ..
cd ~/Music
Use single tab Use double tab (to see the possible folder/file name)
To list the directory:
ls -la --Finding hidden folders
To create a directory:
mkdir
To remove a directory (recursive):
rm dir-rf
Copy file:
cp
Remove file:
rm
To find the file/folder:
locate
Update the database for use in “locate” command:
updatedb
Create a text file:
echo "Hi!" > test.txt
To view, create, and edit file:
echo
cat
replacing vs appending (> vs >>)
touch
nano
gedit
Permission
drwxr-xr-x – first digit (d means directory, – means file), 2-4 digits – permission for owner, 5-7 digits – permission for group members, 8-10 digits – permission of other user
Change access:
chmod
chmod 777 -- Giving full access
Network
To find IP local machines:
ifconfig
To find a wireless networking interface:
iwconfig
To ping:
ping
To display and modifies the Internet-to-adapter address translation tables used by the Address in Networks and communication management:
arp
arp -a
To monitor for connections over the network:
netstat
netstat -ano
To do route:
route
Services
To start and stop service:
services
To spin up a web server for Python:
phyton -m SimpleHTTPServer 80
phyton -m SimpleHTTPServer 8080
To enable or disable on boot:
systemctl
Installing and Updating Tools
To update and upgrade:
apt-get update && apt-get upgrade
To install “git”:
apt-get install git
The End
Congratulation on reaching the end of this post. We hope we have shed some light on outlining the Linux commands – a quick cheat sheet.
We write this so that this is not a fixed article. Like in this journey, we learn as we go and re-write some parts, so please keep pinging with this article.
We also would love to hear about how you deal with the situation and what problems you might be facing. Please feel free to comment below this article or jump into our Dewachat and let us know if you have any questions we can answer!
To boost your product and service to the broader web community, you can visit our Dewalist classified website – home to 33,000+ active users and 40,000+ one year of active advertising so far. Check it out!
If you love this article or any tech posts and you would like to receive an update of this article or our latest post, please sign up for the form below: