Linux Commands

who: Linux who command shows who is logged on to the system. This is a useful command for a Linux system administrator because they can check how many users currently logged in the system and who they are. who am i: who am i shows the ID of current user echo: It is typically used in shell scripts and batch files to output status text to the screen or a file. set: Displays, sets, or removes environment variables. Syntax SET [variable=[string]] Specifies the environment-variable name. Specifies a series of characters to assign to the variable.

variable string

Type SET without parameters to display the current environment variables. Type SET variable= without a value to delete variable from the environment. Type SET variable=value to assign value to variable. We can use %variable% in batch files whenever you need its value.

cat: This is used to display text files on screen
  

Copy text files Combine text files

Create new text files Syntax  Copy $ cat oldfile.txt > newfile.txt

 ls .  ls ~ :List the contents of your home directory by adding a tilde after the ls command  ls / :List the contents of your root directory. Below is additional information about each of the fields this command lists.text write text after pressing enter (to save and exit press ctrl+D) Mkdir:this command is used to create directory Rmdir:this command is used to remove the director ls:Lists the contents of a directory  ls –l :this would list each of the files in the current directory and the files permissions. the size of the file. . and the file name or directory./ :List the contents of the parent directory. Displaying Text $cat filename  Combine text files cat file1 file2 > newcombinedfile  Create new files $cat foo.. date of the last modification.

txt 5 = Lines 13 = Words 57 = Characters PATH: In UNIX / Linux file systems. Only complete word matches are displayed dir: used to list directory contents uname: print name of current system date: tells us the date and time in Linux date '+DATE: %m/%d/%y%nTIME:%H:%M:%S' .txt. words. the human-readable address of a resource is defined by PATH. pwd is a Linux command to print the directory you're currently working in when at the command line. On Unix / Linux like operating systems. and characters in a file Example-wc Ankit.txt Displays information about the file myfile.Pwd: Short for print working directory. Below is an example of the output. 5 13 57 myfile. cd: Changes the directory Syntax cd [directory] wc: Short for word count. (as well as on DOS / Windows and its descendants). wc displays a count of lines. PATH is an environment variable listing a set of paths to directories where executables may be found man: The man command is short for manual and provides in depth information about the requested command or allows users to search for commands related to a particular keyword whatis: whatis searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output.

chown: Command for system V that changes the owner of a file. awk is a script processing language also known as oawk.txt Templates/Ankit. Weinberger. df: Report how much free disk space is available for each mount you have. DATE: 02/08/01 TIME:16:44:55 cal: calendar for the month and the year Syntax cal [month] [year] bc: Calculator cp: Copies files from one location to another example: cp /Downloads/Ankit. comm: Select or reject lines common to two files . apropos: apropos searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output awk: Short for Aho. mv: Renames a file or moves it from one directory to another directory. example: chown chope file.txt clear: used to clear the command prompt cmp: Compares two files and tells you what line numbers are different. gawk.txt copies the Ankit. and Kernighan. mawk and nawk allows for pattern scanning and processing.Would list the time and date in the below format.txt Give permissions as owner to user chope for the file file.txt file into the templates directory rm: Deletes a file without confirmation.

shell or log you out of a Unix network . exit: Allows you to exit from a program.grep: Finds text within a file sed: Sort for Stream Editor sed allows you to use pre-recorded commands to make changes to text.

Sign up to vote on this title
UsefulNot useful