Giter VIP home page Giter VIP logo

portfolio's Introduction

Basic linux commands

man

Stands for manual,used to show you the manual of a command

  • man

  • man ls

    • Navigating the man pages

      "space" Go forword one window.
      "enter" Go forword one line.
      G"b" Go backword one window.
      "/" Search for something in the man.
        Eg./space : search for "space" in man
      "n" Repeat previous search,"next".
      "q" Exit the man page

    • manls

      This command will not work because "manls" deferent than "man ls"

    • man 3 ls

      This also will not work because "man 3" used to store C Standard library

ls

Used to list the content of a directory (files & directories)

  • ls
    List the content of the current directory
  • ls -l
    Show more details,like permissions & size
  • ls -h
    Make the result human readable but not in this case we need to combined it with -l and -s, print sizes like 1K 234M 2G etc.
  • ls -l -h ....vs.... ls -lh
    This two commands are the same, because -h & -l can be combined into one option -lh
  • ls -lct
    List the content sorted by the last time of modification
  • ls -a
    Show the hidden content as well
  • ls /etc/
    List the content of /etc directory
      - /etc: contains system configuration
  • lsusb
     List informations about USB buses in the system and the devices connected to them. /pre>  
    
  • ls --color
      --color=auto : give each file type deferent color
      --color=never : this is the default(show all file types with the same color)

pwd

Print the Working Directory (print the full path of where you are)

cd

Change the Directory (cd PATH)

  • cd "or" *cd ~*
    Go to user home directory
  • cd /
    Go to root directory
  • pwd
    this will print "/" beacause we are in the root directory
  • cd ..
    Go back one level up from the current directory
  • cd /usr/bin
      Go to /usr/bin directory
      - /usr/bin: contains most of the executable files
  • cd -
    Change to the previous working directory & the writes its name

Practice

  • Setting up a new user to practice in a clear environment
    $ sudo useradd coco
    $ su - coco
    1. Return to the User directory, create a new direc tory using the command "mkdir", delete this directory with "rmdir" then return to the root directory.
    $ cd
    $ mkdir myDir
    $ rmdir myDir
    $ cd /
    1. Create the directory again in the same location without changing the current directory (until further notice).
    $ mkdir ~/myDir
    1. Create a file with the “touch” command in the user folder.
    $ touch ~/myFile
    1. Copy the file to the directory previously created using the "cp" command, then delete the original file using the "rm" command.
    $ cp ~/myFile ~/myDir/myFile
    $ rm ~/myFile
    1. Move the remaining copy to the user directory using "mv", move now to the directory you created and bring the file back there again.
    $ mv ~/myDir/myFile ~
    $ cd ~/myDir
    $ mv ../ .
    1. Make a copy of your directory and its file, in a new directory, using of "cp" using the appropriate option, what do you notice?
    Running just "cp" will not work for copying directories,
    We need to add "-r" option.
        $ cp -r . ../myDir2
    1. Again make a copy of the source directory and its contents inside the last directory created.
    $ cp -r . ../myDir2/myDir3
    1. Create a symbolic link (shortcut) of the file with the longest tree structure to the first directory with the command "ln", then delete everything with a single command without asking for confirmation
    $ cd ; tree

    $ ln -s myDir/myDir2/myDir3/myFile .

    $ rm -r ~/*
    1. Create a text file containing a few lines without having to use an editor using the command "cat> file" use the Ctrl-C combination to terminate
    $ cat > myFile 
    1. Display the contents of the file using the "cat" command while numbering the files. lines.
    $ cat -n myFile
    1. Display myFile page by page by concatenating the empty lines without breaking the lines long using "more"
    $ more -s myFile
    1. Display your file page by page with a long prompt (display of the percentage of browsed file) by displaying special characters without filling empty lines with ~ using "less"
    • First methode
    $ grep '\S' jj | cat -e | less -M +Gg
  • Secound methode
    $ awk NF jj | cat -e | less -M +Gg

portfolio's People

Contributors

ayoub-elmendoub avatar

Watchers

TIJANI ABDELLATIF avatar  avatar

portfolio's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.