Linux basic commands

Linux logo

Momentarily I’m working at a more complex list of Linux command, but for now  I’m giving you this little preview with basic commands which you can use in a Linux environment.



whoami confirms the current user
hostname confirms the current domain
clear remove previous content from the terminal
exit close the shell terminal window
reboot restart your system
pwd shows the current working directory
logname reveals the name of the user who began the shell session
su login as the root superuser
who -r see the run level details
echo prints out any arguments supplied to the command
env displays a list of standard “environment variables”
cd switch to any directory with the absolute address as argument
cd~ return to home directory
cd.. moves up one directory
-a see all the directory content
-l see long format listing for each item
-t sort the content by the time they were created or last modified
-o supress group ownership details
-g supress user ownership details
basename extract the name of a file, program, or directory from the end of the path address
dirname remove the final part of path address to a file
mkdir create a new directory
rmdir remove directories from the shell
mv move files around your Linux system
cp copy a file to a new location
rm delete one or more files named as its arguments
readlink discover the target to which a symbolic link is pointing
stat list every important atribute pf the file stated as its argument
touch change the last accessed and last modified timestamp attribute of a file
cmp check if two files are identical
cksum generates a Cyclic Redundancy check value and includes the files byte size in the output
find locates a file in the shell
cat view a text file in the shell
head lets you preview the first ten lines of a text file
tail lets you preview the last ten lines of a text file
sort display lines of a text sorted alphabetically
grep displays all lines from a text file that contain a specific string or pattern
look output all lines of text from a file that begins with a specified prefix
gzip compact one or more files into a single archive
unzip extract the contents of an compressed archive
df shows how filesystems are being used, by indicating free space
fsck check for integrity and errors
kill terminate a process
useradd create a new user
chfn change personal information details of an user
finger shows the personal details of any specified user
date displays the date, time, and timezone
cal display a calendar of the current month, and highlights the current day
if config displays  the network interface configuration
ping tests if a computer is reachable across the network
ftp launches an interactive FTP console
lpr takes a filename or a path as its argument to establish a print job to send specified file to the printer
expr enables you to perform simple math calculations at the shell prompt

Leave a Reply