grep command in unix/linux
Grep: grep is one of many standard UNIX utilities. It searches files for specified words or patterns. First clear the screen, then type% grep college college.txtAs you can see, grep…
q
Grep: grep is one of many standard UNIX utilities. It searches files for specified words or patterns. First clear the screen, then type% grep college college.txtAs you can see, grep…
The “who” command lets you display the users that are currently logged into your Unix computer system.whoThis is the basic who command with no command-line arguments. It shows the names…
To Start vi: To use vi on a file, type in vi filename. If the file named filename exists, then the first page (or screen) of the file will be displayed;…
#include #include #include #include #include void main() { int fd; struct stat buf; fd=open("f5.txt",O_RDONLY|O_CREAT,600); if(fd!=-1) { if(fstat(fd,&buf)==0) { printf("mode of fileis %u",buf.st_mode); printf("n size of the file is %u",buf.st_size); printf("n…
cp COMMAND: cp command copy files from one location to another. If the destination is an existing file, then the file is overwritten; if the destination is an existing directory, the…
mv COMMAND:mv command which is short for move. It is used to move/rename file from one directory to another. mv command is different from cp command as it completely removes…
ls COMMAND:ls command lists the files and directories under current working directory.SYNTAX:The Syntax isls [OPTIONS]… [FILE] #include #include #include #include #include void main() { DIR *dp; struct dirent *dirp; dp=opendir(".");…
1) pwd COMMAND:pwd – Print Working Directory. pwd command prints the full filename of the current working directory.SYNTAX:The Syntax ispwd [options]2) cd COMMAND:cd command is used to change the directory.SYNTAX:The Syntax iscd…
clear opt=y while [ $opt = y ] do clear echo "----------Menu driven program --------" echo echo echo "1. Usage of tail command " echo echo "2. Usage of cmp…
clear echo "enter the file name" read fname1 echo "enter the contents of $fname1 and press ctrl+d" cat >$fname1 echo "enter the file name 2" read fname2 echo "enter the…