In continuation to Previous Post “How to Install Linux”
Step 1 : Listing Files and Dirs - Some basic commands
clear -> clear the screen
ls -> list content
ls -l -> list content in long listing format
ls -al -> list all subcontent in long listing format
ll -> an alias for the above
ls -R -> list content recursively
l. -> list hidden files
ls -F -> list content and classify them
alias -> display all aliases for current user
alias -> make alias eg alias c='clear'
unalias -> remove alias eg unalias c
exit -> log out from the system
logout -> log out from the system
^d -> log out from the system
tree -> list content in a tree (hierarchial) diagram
tree -d -> list subdirectories only - no files
tree -p -> list content with their permissions
cd (directory) -> change directory to...
cd .. -> change to parent directory
cd - -> change to previous directory
cd -> change to home directory
cd ~ -> change to home directory
pwd -> print work (current) directory
pwd -P -> print parent working dir of this symlink dir
Step 2 : Working with Files / Dirs
mkdir (directory) -> make directory
mkdir -p (directory) -> make parent directories also if it does not exist
touch -> make a 0 byte file if it does not exist
or update date stamp of file if it exists
cp -> copy (for files)
cp -a -> copy (for directories)
cp -p -> copy and preserve date and time
mv -> move OR rename
rmdir -> remove empty directory
rm -> remove (for files)
rm -f -> remove forcefully ( " " )
rm -r -> remove recursively (for directories)
rm -rf -> remove recursively and forcefully ( " " )
cat -> display content of the file
cat -n -> display content of the file and number the lines
Step 3 : Date and Time
cal -> display calendar for current month
date -> display system date and time
date -s (value) '' -> change system date and time in mm/dd/yy
hwclock -> display the hardware clock
hwclock --hctosys -> set the system time from the hardware clock
Step 4 : Soft link and Hard Link
ln -s -> make a soft/sym/symbolic link
ln -> make a hard link
Step 5 : Linux Editors - pico, mcedit, vi
history -> display the list of the last 1000 commands
! 100 -> Run command 100 in history
vi -> text editor
pico -> text editor
mcedit -> text editor
joe -> text editor
Step 6 : Other Basic
aspell -c (filename) -> check the spelling in the file
lynx -> web browser
lynx -dump
links -> web browser
elinks -> web browser
mtools
======
mdir
mcopy
mformat
file -> display the type of file
which -> display the path of the binary
hostname -> display system name with domain
id -> display id info of current user
id -u -> display user id of current user
id -un -> display username of current user
id -g -> display group id of current user
id -gn -> display groupname of current user
uptime -> display for how long the system has been running
tty -> display current terminal number
users -> display no. of users currently logged in
whoami -> display username of current user
who -> display users logged in the system with their respective terminals and time since logged in
who am i -> display current user, terminal and uptime
w -> display is details which files are open on which terminal
finger
finger (user)
pinky
pinky (user)
Step 7 : Processes and Daemons
ps -> display process status of current terminal
ps -l -> display process status of current terminal in detail
ps -e -> display process status of all terminals
ps -el -> display process status of all terminals in detail
uname -s -> display kernel name
uname -r -> display release
uname -v -> display version
uname -p -> display processor type
uname -m -> display machine type
reset -> reset the current terminal
locate (file) -> searches /var/lib/slocate/slocatedb
Use updatedb* to rebuild the database
find <$file> -name (file) eg find / -name dad -print Find file "dad"
eg find / -name "dad*" -print Find all files
starting with dad
Step 8 : System shutdown :)
init 6 -> reboot the system
reboot -> reboot the system
shutdown -tx -r now -> reboot the system where x is in seconds
shutdown +x -> reboot the system where x is in minutes
init 0 -> shutdown system
halt -> halt the system after shutdown
poweroff -> halt the system after shutdown
- Cheers