Archive for the ‘UNIX’ Category

Linux and Unix Tail Command

Tail command used to display the last 10 lines of a file in Linux or UNix systems.By default, it displays last 10 lines of the file. But, we can get last 100 or 200 lines of a file. Usage: tail [OPTION]… [FILE]… Options: Mandatory arguments to long options are mandatory for short options too.

Linux command to list all available commands

Linux commands those will list all available commands and aliases for current terminal session: compgen -c will list all the commands you could run. compgen -a will list all the aliases you could run. compgen -b will list all the built-ins you could run. compgen -k will list all the keywords you could run. compgen […]

Linux commands

Linux /unix Client machine: Windows operations systems Windows msDos Windows 95 Winodows 98 Windows xp Windows vista Windows 7 Windows 8 Windows10 Server editions: Windows 2000 server Windows 2003 server Windows 2008 server

egrep command

the egrep command is the most powerful member of the grep command family, you can use it like fgrep to search for multiple targets. Like grep, it allows you to use regular expressions to specify targets, but it provides a fuller, more powerful set of regular expression the gr The grep command accepts all of […]

fgrep command in unix

the fgrep command is similar to grep, but with 3 main differences, you can use fgrep to search several targets at once, it does not allow you to use regular expressions to search for patterns, and is faster then grep.when you need to search a large files or several small files the differences in speed […]

Using grep to locate files

If you give grep two or more files to search, it it includes the name of the file before each line of output. The following command searches for lines cintaining the string “JAVA” in all of the files in the current directory. $grep JAVA * schools : 100 vinod java k2schools k2schools: 110 rajesh java […]

filter commands in unix

The grep command searches one or more files for lines containing a target and then prints all of the matching lines its finds. For example the following command prints all lines in the file “k2schools” that contains the word “schools”. $grep schools k2schools select your class in k2schools Using grep for queries: grep is used […]

file compression

There are 2 commands to zip the files in unix compress pack Compress: Syntax – $compress filename The result of the above command is filename.Z $compress -v filename The optional -v (for verbose) option files compress to report how much space it saved. For example, in the above case it is it reported the following: […]

changing the owner of a file

Every file has a owner, usually the person who created it. When you create a file, you are its owner. The owner usually has broader permissions for manipulating the file than other users. Some times you need to change the owner of a file, for example if you take over the responsibility for a file […]

Using umask to set permissions

The chmod command allows you to alter permissions on a file by file basis. The umask command allows you to do automatically when you create any file or directory. Every one has a default umask setting set up either by the system administrator or their .profile. Umask allows you to specify the permissions od all […]

Powered by k2schools