One command to see everything

testing935
7 years ago | edited 7 years ago

0

I’m on challenge On which I have to display the entire directory of a server, I find the trick but not the command (it is a linux server)

The thing that works is:

ls -R

(On linux) do you know of commands that searches ALL directories even see hidden directories?

Because I only display

.: includes index.php ./includes: about.php contact.php home.php File does not exist

Thank in advance for your answers

12replies
3voices
295views
SIGKILL [r4v463]
7 years ago | edited 7 years ago

0

ls -Ra / will print all the files and the directories of the server (including hidden files). What do you mean by [quote=testing935]I find the trick but not the command[/quote] ?

testing935
7 years ago

0

.: . .. ._nginx.http-level.inc ._nginx.server-level.inc ._php-fpm.pool.inc .passwd includes index.php ./includes: . .. about.php contact.php home.php File does not exist

Thank R4v4 I can see .passwd

x)

SIGKILL [r4v463]
7 years ago

0

You’re welcome ;) you can combine this command with others to have less outputs.

testing935
7 years ago

0

Would you have any examples? Little tricks nice to know?

SIGKILL [r4v463]
7 years ago

0

If you only want an information on a specific file, you can do ls -Rla / | grep x where x is the name or a part of the name of the file you’re looking for.

I just think of another command equivalent to ls -R which is tree. It’s a better command to do it. If you want the full path of a file on a server you can do tree -fa / | grep x where x is the name or a part of the name of the file you’re looking for.

To explain, tree is equal to ls -R. The flag -f of tree means that you will print the full path for each file. the flag -a means that it will print all hidden files. the operator “|” means that you send the output of the first command to the second command. Grep by default will only returns you the lines that matches the regex you type as parameter to grep.

testing935
7 years ago

0

Good

thannnnnk my friend

XD

SIGKILL [r4v463]
7 years ago

0

You’re welcome ;)

testing935
7 years ago | edited 7 years ago

0

.: total 32 dr-xr-x--- 3 web-serveur-ch47 www-data 4096 Nov 27 2016 . drwxr-s--x 51 challenge www-data 4096 Dec 11 13:27 .. -r-------- 1 challenge challenge 90 Nov 20 2016 ._nginx.http-level.inc -r-------- 1 challenge challenge 727 Nov 20 2016 ._nginx.server-level.inc -r-------- 1 challenge challenge 197 Nov 20 2016 ._php-fpm.pool.inc -rw-r----- 1 web-serveur-ch47 www-data 192 May 7 16:06 .passwd drwxr-sr-x 2 web-serveur-ch47 www-data 4096 Nov 20 2016 includes -rw-r----- 1 web-serveur-ch47 www-data 789 Nov 20 2016 index.php ./includes: total 20 drwxr-sr-x 2 web-serveur-ch47 www-data 4096 Nov 20 2016 . dr-xr-x--- 3 web-serveur-ch47 www-data 4096 Nov 27 2016 .. -rw-r----- 1 web-serveur-ch47 www-data 54 Nov 20 2016 about.php -rw-r----- 1 web-serveur-ch47 www-data 159 Nov 20 2016 contact.php -rw-r----- 1 web-serveur-ch47 www-data 78 Nov 20 2016 home.php File does not exist

It works well in addition XDDDDDDDDDDD

Look :

#after ls -Rla | grep .passwd -rw-r----- 1 web-serveur-ch47 www-data 192 May 7 16:06 .passwd File does not exist

testing935
7 years ago

0

Alway the probleme even, I cann’t open the file which contains the password

ls -afhltr

When I open with this command

ls -afhltr .passwd

or

ls -afhltr ./passwd

Are there commands to read the file like

chmod

Smyler [WHGhost]
7 years ago

0

If you want to see the content of the file, use cat:
cat .passwd

SIGKILL [r4v463]
7 years ago

0

@testing935 It’s probable that you don’t have the right to read this file.

testing935
7 years ago

0

It’s good

I’ve find the problem x)

You must be logged in to reply to this discussion. Login
1 of 13

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss