0% found this document useful (0 votes)
32 views36 pages

Technology Essentials1 Linux

The document lists Linux commands and their descriptions. It provides examples of how to use each command. Some key commands covered include ls to list files, cd to change directories, cp to copy files, rm to remove files, mkdir to create directories, and grep to search files for text. Character shortcuts and wildcards are also described, such as / for directory separator, * to represent one or more characters, and [] for ranges. Common directories in the Linux file system are outlined, including /root, /home, /bin, /etc, and others.

Uploaded by

aligamergames999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views36 pages

Technology Essentials1 Linux

The document lists Linux commands and their descriptions. It provides examples of how to use each command. Some key commands covered include ls to list files, cd to change directories, cp to copy files, rm to remove files, mkdir to create directories, and grep to search files for text. Character shortcuts and wildcards are also described, such as / for directory separator, * to represent one or more characters, and [] for ranges. Common directories in the Linux file system are outlined, including /root, /home, /bin, /etc, and others.

Uploaded by

aligamergames999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Command Description Example

ls List files and directories ls ls /home ls –al ls –al /home/student

cd Change current directory cd /home

pwd Print current directory pwd

cp Copy files cp [Link] /home cp [Link] [Link]

mv Move or rename file mv [Link] /home mv [Link] [Link]

rmdir Remove empty directory rmdir test

rm Remove file or Non empty directory rm [Link] rm –r test

mkdir Create directory mkdir test

cat Print file content cat [Link]


Command Description Example

grep Search for text in file grep “word” [Link]

head Display the first 10 lines of a file head [Link] head –n 5 [Link]

tail Display the last 10 lines of a file tail [Link] tail –n 5 [Link] tail –f [Link]

less Display text from file in one screen less [Link]

ps Display list of running processes ps aux

lsof Display list of open files lsof –i

netstat Display network connections netstat –antp

ifconfig Display network information ifconfig

sort Sort content of a file sort [Link]


Command Description Example

uniq Remove duplicate lines (sort first) uniq [Link]

stat Display information about a file stat [Link]

ping Test network connectivity ping [Link]

whoami Display current user whoami

passwd Change user passwd passwd student

kill Terminate process kill 1845

ln Create link file ln –s file link ln file link

find Search on files find / -name [Link] find / -name "*.txt"

nano Text editor nano filename (Save file : Ctrl+X )


Character Description Example

/ Directory separator cd /home/student

\ Escape character mkdir test\ dir

. Current directory ls . cat ./[Link]

.. Parent directory ls .. cat ../[Link]

~ User home directory cd ~

& Run in background gedit &

* Represent one or more characters ls *.txt

? Represent single character ls a?.txt

[] Represent range of values ls a[0-9].txt


Character Description Example

; Command separator (run anyway) pwd ; whoami ay7aga ; whoami

Command separator (run second


&& pwd ; whoami ay7aga ; whoami
command if the first succeed)

Command separator (run second


|| pwd ; whoami ay7aga ; whoami
command if the first failed)
Directory name Directory description
/ Root directory, every thing starts from there.
/root Root home directory, contains Desktop, Downloads, Documents and so on.
/bin Contains users binaries (ls, cp, cat).
/sbin Contains system binaries (reboot, ifconfig, fdisk).
/etc Contains system configuration files.
/home Home directory for all users (/home/student, /home/testuser).
/boot Contains boot load files and kernel files.
/lib Contains system libraries.
/var Contains variable data which is continuously change in size (log files: /var/log).
Contains user programs and it contains another bin (/usr/bin) & sbin (/usr/sbin)
/usr
(which contains second level user and system binaries).
/mnt Mount directory where system admin can mount any partitions here.
/tmp Temporary files (delete at reboot).

You might also like