Posts

Showing posts from December, 2017

Basic Commands in Linux - WATCH

Image
watch    watch command is used to see the output of particular command frequently and displays the output. Consider you want to see whether a file in a particular folder was Processed or not. To check this we frequently use ls command or find command to check the file. Instead, we can use watch command for these scenarios watch ls -l - this will run the ls -l command for every 2 seconds and display the output like below. if you want to change the time interval we can use watch -n (sec) command. for example: watch -n 3 ls -l this will run the command for every 3 sec to go back to terminal use ctrl+c.

Basic Commands in Linux - To change the current directory

cd     cd is used to change the working directory. cd // - this will take you to root directory cd .. - this will take you to the parent directory cd folder1 - this will take you folder1 directory cd folder/folder2 - this will take you to the folder2 directory

Basic Commands in Linux - To delete file and folder

rm    rm command is used to remove the files.  rm filename - this will remove the file. rm oel rm -i filename - this will prompt before removal. rm -i owl      rm: remove regular empty file 'owl'?    rm -d folder1 - this will remove the empty folder. rm -d folder rm -r folder - this will remove the folder with its subdirectories. rm -r folder rmdir       rmdir folder - this will r emove the empty directory. rmdir  folder rimdir -p folder/folder1/folder2 - this will remove the folder with its subdirectories. rm -p folder/folder1/folder2

Basic Commands in Linux - To create folder or directory

mkdir    mkdir used to create a folder or directory. mkdir [OPTION]... DIRECTORY.. .   mkdir bill - this will create a folder called bill in current directory mkdir bill mkdir john smith - this will create two directory john and smith at same time. mkdir john smith  mkdir -p never/give/up - this will create never as parent directory which contains give and give contains up. mkdir -p never/give/up

Basic Commands in Linux - To display list of files and folders in a directory or folder

ls    ls is used to display the list of files in current folder. here you can see only few option . To know more options please comment below. ls - list of files in current folder. ls  ls -a - this will list all the files including hidden one. hidden files will start with . (.filename.txt) . ls -a ls -l - this will display size,access,owner,date modified details of files or folders ls -lrt

Basic Commands in Linux - To create a file

Touch     Touch is used to create an empty file, Touch can also be used to change the date and time of the file. touch [filename]  - This will create an empty file. touch bill touch -t mmddhhmm [filename] - this command will change the date and time of the file. touch -t 10101213 bill

Basic Commands in Linux - To display current directory or folder

PWD     This command will show you the current directory in which you are working. pwd - this command will display output as below, showing your current directory or folder. /home/jaravis/files

Basic Commands in Linux - To display Date And Time

Date     Date is used to display the current date and time in your terminal. Date command provides lots option to display date and time. Here you can find the small range, Please comment if need to know more option. date - this will display the date and time with coordinated universal time. date date +%A - this will display current weekday full name. date +%A date +%a - this will display the current weekday short name. date +%a date +%B - this will display the current month full name. date +%B date +%b - this will display the current month short name. date +%b date +%C - this will display the current Century. date +%C  date +%c - this will display local date and time. date +%c date +%D - this will display simply date with month and year. date +%D date +%d - this will display just current date. date +%d

Basic Commands in Linux - To display calendar

Cal   Cal is used to display calendar on your terminal. cal - this will display current month. cal cal yyyy - this will display entire calendar for the year. cal 1992 cal mm yyyy - this will display particular month of that year. You can also use short form of month as feb in place of mm to display February month of your year calendar cal 12 2017 cal feb 2017 cal -w - this will display the calendar with week numbers. cal -w cal -m  this will display Monday as first day of week   cal -m    cal -s   this will display Sunday as first day of week   cal -s   

What is Linux?

Linux is the free and open-source operating system. Linux - based system is a modular UNIX like operating system, deriving much of its basic design from UNIX. Linux was primarily written in C language. Linus Torvalds released the first kernel on September 17,1991. Now, Linux is packaged and used in desktop and server as Distribution which is commonly known as ' distro '. Arch Linux, CentOs, Debian,Fedora,Linux Mint,OpenSUSE, Ubuntu .. etc are most popular Linux distribution.