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.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay