Thursday, February 4, 2021

Basic Linux Command

 

Ø File Handling Linux Commands


# man command (show all information about this command) 
# pwd (print [current] working directory)
# cd (change [current working] directory)
# cd (return to your original directory)
# ls (list directory)
# ls -a (show all directory include hidden directory)
# ls -l (show all directory with property like size, ownership etc.)
# ls -al (show all directory include hidden directory with property like size, ownership etc.)
# mkdir d (Create new directory d)
# rmdir d (Remove directory d)
# rm f1 [f2...] (Remove file(s) f1...)
# rm -rf d1 [d2...] (Recursively remove all files in the directories)
# mv f1 [f2...] d (Move file f to directory d)
# mv d1 d2 (Rename directory d1 as d2)
# cp source-file(s) destination (copy file one directory to another)
# cp f1 f2 (Copy file f1, and name it as f2)
# cp -r d1 d2 (Recursively copy a directory d1, and name it as d2)
# ln -s realFileName linkName (Create a symbolic link to realFileName and name it as linkName)
# chmod mode f (Change protection mode of f)
# less f (Show file contents of a text file f)
# cat > hello.txt (Create file and input from keybord)
# history (print recently used commands)

  
Ø Check the Linux Version, Release name & Kernel version

# uname -a (Print all Information)
# uname -r (Print the kernel name)
# cat /p
# roc/version
# cat /etc/issue
# cat /etc/redhat-release
# lsb_release –a
# tail /etc/redhat-release


Ø Check Swap Space

# swapon –summary (summary of swap space)
# cat /proc/swaps (swap usage information)
# free -h (display use and free swap space in gigabyte)
# top (use to check swap space)

  
Ø Linux System Administrator
   
# uptime (show system running time and currently logged users)
# uptime -v (check uptime version)
# w (shows who is logged into your system and what they are currently doing)
# users (show who are currently logged in to your system)
# who (return user name, date, time and host information)
# who -b (Displays last system reboot date and time)
# who -r (Shows current runlet)
# who -a (Displays all information in cumulatively)
#  crontab -l (List schedule jobs for current user)
# service httpd start(execute the script)
# top (displays processor activity of your system and also displays tasks managed)
# last (display terminal, time, date, system reboot or boot)
# ps -ef | grep init (show init process only)
# kill- 9 7508(Process ID) (kill command to terminate process)
# reboot (restart the system)
# init 6 (restart the system)


Ø File System

# cat output.log | less or more (view file)
# whoami (Prints the username of the user that you are currently logged in)
# locate text.txt (Find files on your system by name)
# sort file.txt (Sorting lines of files in ascending order)
# sort -r file.txt (Sorting lines of text files in descending order)
# vi /etc/test.txt (text editor)
# free (Free command shows free, total and swap memory information in bytes)
# free -h (Free command shows free, total and swap memory information in gigabyte)
# grep test /etc/passwd (grep search for a given string in a file)
# grep -i serachstring /etc/passwd (grep search for a given string in a file)
# find / -name test (used to search files, strings and directories)
# lsof -u erpdev (List of all open files by user erpdev)


Ø Archival

# tar -cvf archive-name.tar /home (tar command is used to compress files and folders)
# tar -xvf archive-name.tar (extract tar archive file)
# zip original.zip original (zip original file)
# unzip original.zip ( unzip original.zip file)


Ø Network

# ssh -v (check the version of ssh user)
# ssh remote_host (you connect to a remote host)
# scp (Copy files securely and remotely over servers)
# ftp 192.168.50.2 (used to connect to remote ftp host)
# sftp 192.168.50.2 (sftp is secure file transfer protocol)
# ftp > mput *.txt (Putting multiple files in remote host)
# ftp > mget *.txt (mget to download multiple files from remote host)

No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...