The other day one of my friends who is a Windows user asked me to basic Linux commands because he wanted to improve his IT skills. I helped him out and also decided to put together a brief list of basic Linux commands for newbies while having fantastic Latin America coffee at home.
Basic Linux Files and Navigation Commands
Command
Description
ls
List of files/directories in current directory
ls -l
Formatted listing
ls -la
Formatted listing including hidden files
cd <dir>
Change directory to <dir>(<dir> is directory name)
cd
Go to your home directory
pwd
Show current path
mkdir
Make a directory e.g. mkdir holadir
rm
Remove a file e.g. rm myfile
rm -r
Delete a directory e.g. rm -r mydirectory
cp
Copy files e.g. cp myfile yourfile
mv
Rename files e.g. mv myfile yourfile
Files and Navigation Linux Commands
Networking Basic Linux
Command
Description
ping
Ping a host
whois
Get whois for a domain
dig
Get DNS for a domain
wget
Download a file
wget -r <url>
Recursively download files from url
curl <url>
Output webpages from url
ssh user@host
Connect to host as user
ssh -p <port> user@host
Connect to host as user using a port
ssh -D user@host
Connect and use bind port
Basic Networking Linux Commands
Viewing Processes Basic Commands
Command
Description
ps
Display current active processes
ps aux
Detailed processes output
kill pid
Kill processes id (pid)
killall <processName>
Kill all processes named <processName>
Viewing Processes Linux Commands
Basic Linux System Information
Command
Description
date
Show current date/time
uptime
Show system uptime
whoami
Show who you’re logged in as
w
Display who is online
du -sh
Displays readable space in GB
df
Show disk usage
uname -r
Show kernel version
Viewing Linux System Information
Basic Linux Permissions Commands
Description
chmod <octal file>
Change permissions of file
4
read(r)
2
write(w)
1
execute(x)
order
owner/group/world
chmod 777
rwx for everybody
chmod 755
rwx for owner, rx for group and world
Basic Linux Permissions table
Contact me if you’re confused about anything that I wrote here. Cheers.