BASIC LINUX COMMANDS
System
hostnamectl
Display information about the CPU architecture
lscpu
Listing files and directories
ls
Detailed listing
ls -l
Lots of details about the contents
of your directory
The * wildcard
ls d*
This will list all files in the
current directory starting with d
Making Directories
mkdir tom
Changing to a different directory
cd tom
Change to the parent directory
cd ..
will take you one directory up the hierarchy.
Command |
Meaning |
ls |
List files and directories |
ls -a |
List all files and directories |
mkdir |
Make directory |
cd directory |
Change directory |
cd |
Change to the home directory |
cd ~ |
Change to the home directory |
cd .. |
Change to the parent directory |
pwd |
Display the path of the current directory |
man |
Display manual |
ping |
Check internet connection |
wget |
Download files |
Copying and Moving Files
Command |
Meaning |
cp file1 file2 |
Copy file1
and call it file2 |
mv file1 file2 |
Move or
rename file1 to file2 |
rm file |
Remove a
file |
rmdir directory |
Remove a
directory |
rm -rf directory |
Remove a
directory and its files |
cat file |
Display a
file or merge files |
less file |
Display a
file a page at a time |
head file |
Display
the first few lines of a file |
tail file |
Display
the last few lines of a file |
grep 'keyword' file |
Search a
file for keywords |
wc file |
Count
number of lines/words/characters in file |
Other useful Unix commands
Compress and extract files
This
reduces the size of a file, thus freeing valuable disk space
Extract
archive
tar -xzvf archive.tar.gz
Show
command history
history
Open
files using Text Editors
Popular
text editors are vi, nano, gedit, leafpad etc.
Open file
gedit tom.txt
leafpad tom.txt
How
to install Microsoft fonts in Linux office suites
sudo apt-get install ttf-mscorefonts-installer
Update
font cache
sudo fc-cache -fv
REFERENCES
UNIX
Tutorial for Beginners
Comments
Post a Comment