Docsity

pruebas para subir carchivos, Resúmenes de Derecho

Toggle sidebar
bg1
Exercise #1
Using find command
The find command is very similar in its basic function to ls it is used to list all the
contents in a directory as an input. The difference is that by applying filters, it can help
you search for files more precisely.
• In the terminal go to the user directory /home/username .
• Type find command.
• Describe the results received after running the find command.
Using just find will find all the files and folders within the directory we are located on.
• Now let's type
find ./Downloads
• Typing ./Downloads we are searching information inside of a specific directory.
To make more specific searches, it is necessary to specify the parameters, in the
following example we will specify the search by path and file type.
find /home/username -name *.txt
There are several ways to use the wildcard parameter (*) starting with an *. file
extension format, also we can type letters to look for words that start or end in specific
ways.
Example:
find ./Downloads -name test
• Describe the results received.
Exercise:
• Type
find ./Downloads -name test1
• Afterwards you can type
find ./Downloads -name test*
pf2

Vista previa parcial del texto

¡Descarga pruebas para subir carchivos y más Resúmenes en PDF de Derecho solo en Docsity!

Exercise #

Using find command

The find command is very similar in its basic function to ls it is used to list all the contents in a directory as an input. The difference is that by applying filters, it can help you search for files more precisely.

  • In the terminal go to the user directory /home/username.
  • Type find command.
  • Describe the results received after running the find command. Using just find will find all the files and folders within the directory we are located on.
  • Now let's type find ./Downloads
  • Typing ./Downloads we are searching information inside of a specific directory. To make more specific searches, it is necessary to specify the parameters, in the following example we will specify the search by path and file type. find /home/username -name *.txt* There are several ways to use the wildcard parameter () starting with an _. file extension_* format, also we can type letters to look for words that start or end in specific ways. Example: find ./Downloads -name test
  • Describe the results received. Exercise:
  • Type find ./Downloads -name test
  • Afterwards you can type _find ./Downloads -name test_*

Unless you use the exact name of the document, find command will not find files or directories, so if you don't know the full name you can use the wildcard to get better results

Using locate command

The locate command is useful as an alternative to find command when you are trying to locate files or directories that you don't know where are located. From terminal type in: Locate longfile.txt •The result for running the locate command indicates the path of the file. An important note when you are using locate command is that we must know the full name of the document or directory.