Skip to content

vagabon-09/Linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 

Repository files navigation

Linux

In this repository we will learn about Linux commands. For using and implimenting those command open your linux command and press esc button from your computer and enter vi then enter file_name.sh. Now you will redirect into mention fill now pressesc + a for writing command. Now after complet writting progrma press esc + : + wq now you will againg redirec to main command prompt. Now for running this file press sh file_name.sh it will run whole commands of the file. Practice all code in vi editor. ⚠ Please read all the commands very carefully and write it using appropriate spaces and signs.

Linux Commands

  • pwd this command is used to check you are present in which directory
  • mkdir DirectoryName it use to create Directory.
  • rmdir or rm -d used to remove empty directory.
  • rm -r to delete directory that contain sub-directory and file.
  • ls it shows the files/directories in your current directory.
  • ls -R to shows all the files not only in directories but also subdirectories.
  • ls -al gives detailed information of the files.
  • ls -a used to see hiden files (example of hiden files start with a .).
  • cat > filename use to create file and after creating write something in that file.
  • After writing the content press ctrl + d to save the file and return to command.
  • cat filename use to see the content of file.
  • cat file1 file2 > file3 command is used to combine files in to a new file.
  • You can merge more than two file using same command
  • rm filename command is used to remove file from system without confirmation.
  • mv filename directoryname command is used to move file from one directory to another
  • cd directoryname command is used to enter in any directory.
  • cd command is used to come back to previous directory.
  • cat > filename use to create file
  • ctrl + d use to save the file and return to command
  • cat filename use to see file details
  • cat file1 file2 > file3 use to combine files in to a new file.
  • rm filename used to remove file from system without confirmation.
  • nano filename use to edit existing file
  • echo "any thing" use to print
  • read variable_name use to store value in a particular variable
  • echo $variable_name use to print assigned value of the variable
  • expr $variable1 + $variable2 use to print expretion command
  • vi filename.sh use to open filename.sh in editor
  • sh filename.sh use to run filename.sh
  • :wq this command is used to exit from vi editor (if you are in editor moder then first use esc)
  • insert or shift + 0 use to enable edit mode in vi editor
  • function() {your shell} function used to create function (yous curli braces in another line not in same line and end function is calling function).
  • function() {"// your code $1 $2" return xy} function vagabon 09 here $1 $2 are paremater and vagabon 09 are passing parameter to function and return is returning parameter.
  • function() { your shell script $1 $2} next line function a b next line ret=$? in this way we can get values that passing by the function

Assignments

Assignment1

About

In this repository we will learn about Linux

Resources

License

Stars

Watchers

Forks

Packages

No packages published