DEV Community

Luis Gomez
Luis Gomez

Posted on

Learning Terminal (Notes) Day #2

Handle Files & Directories

There are a few parameters that can be useful with command ls

  • ls:

    • S: This modifier give us the list of files and directories ordered by Size
    • r: Sort the list in reverse

-Tree: Show our whole directories as tree structure

  • -L: The L parameter show our tree with the number of levels that we specify

command tree preview

  • mkdir: with this command we can create a new directory or commonly called a folder just we have to type the name after the command and if you want that the folder's name have spaces you have to type between quotation marks.

  • touch: Create a new file

We can create as much files and directories as we want at once just typing the name of the folders or files after the previous one.

  • cp: Command copy as you can imagine this command allow us to copy files just type the name of the file to copy and the name that you want the copy have also you can specify the directory where you want to copy save.

  • mv: It works like copy but moving the files

  • rm: WARNING Take care of this command you can broke your whole Operative System, you can delete files with this command and you can delete directories with parameter -r (recursive). If you type the paremeter -ir you can review and decide if you want to delete the files.

Top comments (0)