100% found this document useful (1 vote)
168 views2 pages

Basic Linux

The document discusses important directories and basic commands in Linux. It lists directories like /bin, /sbin, /etc that contain essential system programs, configuration files, and libraries. It then summarizes some common Linux commands like touch, file, cat, ls, mkdir, rm, pwd, mv, cp for file management tasks like creating, viewing, copying, moving and deleting files and directories. It also mentions commands like history, find, locate, whoami for finding files, viewing command history and checking the current user.

Uploaded by

pkamal0111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
168 views2 pages

Basic Linux

The document discusses important directories and basic commands in Linux. It lists directories like /bin, /sbin, /etc that contain essential system programs, configuration files, and libraries. It then summarizes some common Linux commands like touch, file, cat, ls, mkdir, rm, pwd, mv, cp for file management tasks like creating, viewing, copying, moving and deleting files and directories. It also mentions commands like history, find, locate, whoami for finding files, viewing command history and checking the current user.

Uploaded by

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

Basic Linux Commands and

Information

Important directories of linux:

• /bin
Binaries (executables). Basic system programs and utilities (such as bash).
• /sbin
System binaries. Basic system administrative programs and utilities (such as fsck).
• /etc
Et cetera. Systemwide configuration scripts.
Of particular interest are the /etc/fstab (filesystem table), /etc/mtab (mounted
filesystem table), and the /etc/inittab files.
• /dev
Device directory. Entries (but not mount points) for physical and virtual devices.
• /proc
Process directory. Contains information and statistics about running processes and
kernel parameters.
• /sys
Systemwide device directory. Contains information and statistics about device and
device names. This is newly added to Linux with the 2.6.X kernels.
• /mnt
Mount. Directory for mounting hard drive partitions, such as /mnt/dos, and physical
devices. In newer Linux distros, the /media directory has taken over as the
preferred mount point for I/O devices.
• /media
In newer Linux distros, the preferred mount point for I/O devices, such as CD/DVD
drives or USB flash drives.
• /var
Variable (changeable) system files. This is a catchall "scratchpad" directory for
data generated while a Linux/UNIX machine is running.
• /var/log
Systemwide log files.
• /lib
Systemwide library files.
• /tmp
System temporary files.
• /boot
System boot directory. The kernel, module links, system map, and boot manager
reside here.
Altering files in this directory may result in an unbootable system.

Let's start from some basic Commands -

1 - #Touch = Command can be used for creating a Blank/Empty file. Also It can
change the time of file or directory.
#Touch file name = For changing the file time stamp.
#Touch .filename.txt = For hiding the file from ls command.

2 - #File "file name" = For checking file type.

3 - #echo "the text you want to enter in file" > "file name" = This Command can be
used for putting text into a file.

4 - #cat "file name" = For viewing file's internal text on terminal.


#cat "file name" = For creating a file and press ctrl+d for saving this file.
#cat "file1 file2 file3" = For viewing multiple files.
#cat "file1 file2 > file3" = For transferring file1 and file2 data to file3.

5 - #ls = For short list


#ls -l = For long list view
#ls -a = For hidden files or directories.
#ls -d file name = For Checking file permissions.
#ls -h file name = For human readable format.
#ls -i file name = For file index number.
#ls -t = For latest files first.
#ls .. For going into parent/root directory.
We can use multiple options together.

6 - #mkdir file name = For Creating a directory.


#mkdir .file name = For Creating a hidden directory.
#mkdir data1/data2/data3/data4/data5 -pv" = For creating subdirectories in single
file.
#mkdir filename{1..10}" = For creating multiple folders.

7 - #rmdir file name = For removing empty directory.


#rm -vf file name = For removing a file.
#rm -vr file name = For removing a directory.
#rm -rf file name = For removing directory recursively.

8 - #pwd = For viewing current working directory.

9 - #mv "source file name" "destination file path" define a new name here if you
want to change = For moving a file.
#mv "old name" "new name" = For rename the file.

10 - #cp "source file path" "destination file path" = For copying the file.
#cp -r "source path" "destination path" = For copying a directory.
#-v = For printing what has been done.
#-p = For transferring ownership and time stamp.
Note = You can use three of them together for multiple actions.

11 - #History - This command help us to view previously used command.

12 - #python -m SimpleHTTPServer 1337 - For creating a HTTP server in linux for


transferring files.

13 - #find or locate - For finding files in linux.

14 - #whoami - For finding which user account you are logged in currently.

ALL LINUX COMMANDS:


https://phoenixnap.com/kb/wp-content/uploads/2022/11/linux-commands-cheat-sheet-
pdf.pdf

You might also like