DEV Community

Luis Gomez
Luis Gomez

Posted on

2

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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post