# rm file_name
# rm -rf directory_name
1. touch [create blank file]
2. cat [create blank file,no edit but line can be added]
3. vi [everything can be done]
Creating a file with touch editor
# touch file_name [to create a blank file]
# touch /home/file_name [to create a file in home directory from root directory]
# touch folder_name a1 a2 a3 [ to create more than one file at a time ]
Creating a file with cat editor
# cat > file_name , then write & press Ctrl+D to save.
# cat > file_name [to read a file]
# cat >> file_name [to write in a file from last line]
Creating a file with vi editor
# vi file_name [to create a file, #vi -O a1 a2 (two file at a time),ctrl+w n/s/v/↕]
Then press ‘ i ’ to write and then press ‘Esc’ then write,
1. :w -> to save and exist.
2. :wq -> to save and quit.
3. :q -> to quit.
[ *If files are not save/quit then force the file with ‘ ! ‘, such as write :q! to quit ]
[* Copying line-> press ‘yy’/’4yy’, Deleting line -> press ‘dd’/ ’4dd’ , Paste-> press ‘p’.]
# copy source destination [syntex]
# copy /etc/a1 /root/b1 [to copy a file ‘a1’ from etc to root folder as ‘b1’]
# mv source destination [to move a file/folder]
ZIP & UNZIP
# gzip filename [to zip a file]
# gunzip filename [to unzip a file]
[ *ZIP file extension .gz or .tar or .bz2]
# bzip2 filename [to zip a file]
# bunzip2 filename [to unzip a file]
# vi /boot/grub/grub.conf [ write password=open]
# vi /etc/grub.conf [to change the title of boot louder page]
è press ‘e’ from bootlouder page then select 2nd option from existing three option
è then again press ‘e’ and write =/ single [enter] then select ‘b’ for boot,
è then # passwd root [enter] and after changing the password reboot the system.
# F5 [step 1]
# linux rescue [step 2]
# chroot /mnt/sysimage [step 3]
# grub-install /dev/had [step 4]
# reboot [step 5]
# Linux contains two format-
1. bash [show user nsme & directory]
2. sh [doesn’t show user nsme & directory]
# sh format command:
# sh [to enter ‘sh’ format from ‘bash’ format]
# pwd [to show directory]
# whoami [to show user name]
# hostname [to show host name]
# bash [to enter ‘bash’ format from ‘sh’ format]
# cd /home [to enter home directory]
# cd [to enter root directory from anywhere]
# ls [to show the content]
# cd /etc/;ls [to enter & show the content at a time]
# cd pp [to enter a folder name ‘pp’ not under mount point]
# cd /etc/pp [to enter a folder ‘pp’ under /etc folder]
# ls –F [to show folder]
[ /-> folders , @-> configuration files , *-> execution files , all others are normal files. ]
# ls –s file_name [to show size in KB]
# ls -a [to show hidden files]
# ls -la [to show al files at a time]
[*Blue color or ‘D’ before name -> Folder or , all other colors or ‘-‘ before name -> files.]
# more install.log [to show the whole installing package]
# /usr/bin/setup [to configure hardware, in FedoraCore/Unix-> # /setup ]
# fdisk -l [to show harddisk information]
# df [to show linux partition]
# df -h /dev/hda5 [to show information of D drive]
# history [to show history]
# history -c [to clear history]
# ls –s file_name [to show size in KB]
# ls -a [to show hidden files]
# ls -la [to show al files at a time]
[*Blue color or ‘D’ before name -> Folder or , all other colors or ‘-‘ before name -> files.]
# more install.log [to show the whole installing package]
# /usr/bin/setup [to configure hardware, in FedoraCore/Unix-> # /setup ]
# fdisk -l [to show harddisk information]
# df [to show linux partition]
# df -h /dev/hda5 [to show information of D drive]
# history [to show history]
# history -c [to clear history]
# Linux contains two format-
1. bash [show user nsme & directory]
2. sh [doesn’t show user nsme & directory]
# sh format command:
# sh [to enter ‘sh’ format from ‘bash’ format]
# pwd [to show directory]
# whoami [to show user name]
# hostname [to show host name]
# bash [to enter ‘bash’ format from ‘sh’ format]
*At least one ‘/ ’ and SWAP partition have to create (graphical mode).
Text mode:
1. Create ‘/boot’ partion , need 100 MB free space.
2. Create ‘SWAP’ patition, size double of RAM size.
3. Create ‘/ ‘ partition, need 200 MB free space.
Command Under Root User
# cd /home [to enter home directory]
# cd [to enter root directory from anywhere]
# ls [to show the content]
# cd /etc/;ls [to enter & show the content at a time]
# cd pp [to enter a folder name ‘pp’ not under mount point]
# cd /etc/pp [to enter a folder ‘pp’ under /etc folder]
# ls –F [to show folder]
[ /-> folders , @-> configuration files , *-> execution files , all others are normal files. ]
*Linux SWAP partition-> Double of physical memory(RAM).
* Six urers from F1 to F6.
*Alt+Ctrl+F7-> From text to graphical mode.
*Alt+Ctrl+F1-> From graphical to text mode.
![]()
root@ localhost. root #
User Name User home directory
#-> Root user , $-> Client user
Restart command
# init 6 or reboot
Shutdown command
# poweroff or init 0 or shutdown –h now or shutdown –h 1 (will shutdown in 1 minute).