โ๏ธ Let's Hands-on the Linux Commands for working on Super Useful and Powerful Linux Command Line Interface (CLI) ๐
- sudo :short name for "SuperUser Do" enables to perform tasks which require administrative or root permissions
- ls :list of directories
- stat :details of inode
- gcc file_name.c -o myexe :create object file while compilation and create separate excecutable
- mkdir :make new directory
- rmdir :remove directory
- rm :remove file
- touch :create new file
- make :runs the makefile (makefile: used to manage project)
- cd :enter into directory
- cp :copy files from current directory to diff directory
- pwd :prints current working directory
- cat file_name :list the contents of file
- mv file_name source dest :move file from source to destination
- find :searches for the files and directories
- df :to get report of system disk space usage (in % and kb)
- df -m :to get report of system disk space usage (in mb)
- du :to check space used by file or directory (in blocks)
- du -h :to check space used by file or directory (in bytes, kb and mb)
- tar :used to archieve multiple files
- chmod :to change read, write and execute permissions of file or directory
- ping :to check connectivity status (ping google.com)
- wget :to download required data from internet (eg wget download_link)
- uname :nothing but stands for Unix Name (tells the unix type you are using)
- history :gives list of commands used by you on terminal till date
- zip :zip multiple files
- unzip :unzip the zip folder
- clear :to clean out the terminal with all past commands (but it is still there in history)
- rm -rf .git :to remove hidden .git folder in linux
- shutdown -h now :immediately power off & shutdown the system
- shutdown -h +5 :shutdown the system after 5 minutes
- shutdown -r now :reboot the system
- shutdown -Fr now :force file system check during reboot
- stat(file_name,address of stat object) :gives information about file
- lstat(file_name(path)),address of stat object) :same as stat() but for symbolic links/soft links it returns info of link iself instead of target file
- fstat(file_descriptor,address of stat object) :gives metadata
- access(file_name,mode_of_permission) :return positive int if process has access of the requested mode/mode_of_permission
- opendir() :directory file handling
- readdir() :read contents of directory (data cannot be written in directory)
- closedir() :close the opened directory
- chmod(abs or rel path,mode)( :system call to change the file permisssions mode
- fchmod(file_descriptor,mode) :system call to change the file permisssions mode
- chdir(path) :<unistd.h> change the current working directory
- fchdir(fd) :same as above (both returns 0 on success & -1 on failure)