![]() Documents/secret/christmas-presents.txt Running find without any options or parameters recursively lists all files and directories in the current directory. In case you don’t have find on your system, you can install it using DNF: $ sudo dnf install findutils The manual page has them all: $ man tree findĪnd what about files that live somewhere in the unknown? Let’s find them! To browse and search a huge tree, you can use it together with less: $ tree | lessĪgain, there are other options you can use with three, and you can combine them together for even more power. You can also display a tree of a specific path: $ tree Documents/work/ If that’s too much, I can limit the number of levels it goes using the -L option followed by a number specifying the number of levels I want to see: $ tree -L 2 ![]() Just a warning, this output might be huge, because it will include all files and directories: $ tree Running tree without any options or parameters shows the whole tree starting at the current directory. It’s probably not installed by default which you can do yourself using the package manager DNF: $ sudo dnf install tree If you want to see, well, a tree structure of your files, tree is a good choice. Learn about them by running: $ man ls tree There are many other useful options for ls, and you can combine them together to achieve what you need. Something missing? Looking for a hidden file? No problem, use the -a option: $ ls -a Or a specific file - even with just a part of the name: $ ls *.txt Is can also search a specific place: $ ls Pictures/ rw-r-r- 1 adam adam 43K Nov 2 13:12 notes.txt And together with the -h option you’ll see file sizes in a human-readable format: $ ls -lhĭrwxr-xr-x 2 adam adam 4.0K Nov 2 13:07 Documentsĭrwxr-xr-x 2 adam adam 4.0K Nov 2 13:07 Musicĭrwxr-xr-x 2 adam adam 4.0K Nov 2 13:13 Picturesĭrwxr-xr-x 2 adam adam 4.0K Nov 2 13:07 Videos Just running ls lists all visible files and directories in the current directory: $ lsĭocuments Music Pictures Videos notes.txtĪdding the -l option shows basic information about the files. If you know where your files are, and you just need to list them or see information about them, ls is here for you. We’ll have a look at three of those: ls, tree, and find. Good news is there are few quite useful utilities in the Linux commandline designed specifically to look for files on your computer. In this post, we’ll have a look at how to make sense of your files on the command line, and especially how to quickly find the ones you’re looking for. And if not challenging, it might be time consuming to find the right one you’re looking for. We all have files on our computers - documents, photos, source code, you name it.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |