Difference between revisions of "User:Scott/03"

From FreekiWiki
Jump to navigation Jump to search
Line 16: Line 16:
 
*gconf-editor (configuration)
 
*gconf-editor (configuration)
  
==Locate Files==
+
==List Files==
 
 
===List Files===
 
 
  ls -Ra  [-R recursive] [-a all]  
 
  ls -Ra  [-R recursive] [-a all]  
 
  ls -ti  [-t sort by time] [-i inode]  
 
  ls -ti  [-t sort by time] [-i inode]  
 
  ls -nr  [-n UID & GID] [-r reverse order]
 
  ls -nr  [-n UID & GID] [-r reverse order]
  ls -1   [-1 line by line]  
+
  ls -1F   [-1 line by line] [-F */=@|]
 +
 
 +
===File Attributes===
 +
ls -l
 +
d = directory
 +
l = symbolic link
 +
b or c = device block or char
 +
n = named pipe
 +
s = socket
 +
 
 +
ls –F
 +
@ = linked_file
 +
* = executable_file
 +
/ = subdirectory
 +
= socket
 +
| = named pipe
  
===DU===
+
==Directory Usage==
  
  du -h | less                 (directory usage -h human readable)
+
  du -h | less (-h human readable)
  du -h /home/bob/Downloads/  (list all directories in Download)
+
  du -h /home/bob/Downloads/  (dir. in Download)
  du -ha /home/bob/Downloads/  (list all files & directories in Download)
+
  du -ha /home/bob/Downloads/  (files & dir. in Download)
  
 
  du -ha /home/bob/Downloads/ | grep -i firefox  (find all instances of firefox and -i ignore case)
 
  du -ha /home/bob/Downloads/ | grep -i firefox  (find all instances of firefox and -i ignore case)
  
===Search===
+
==Search Locate Find==
 
  sudo updatedb
 
  sudo updatedb
 
  locate /dir/dir | grep file
 
  locate /dir/dir | grep file

Revision as of 06:26, 19 October 2011

Useful Directory and File Commands

Home Page      user:scott
Tech Support   user:scott/02
Dir & Files    user:scott/03
Network        user:scott/04
Troubleshoot   user:scott/05
Resources      user:scott/06

Template:TOC limit

Favorite Commands

  • history (!2054)
  • gksudo nautilus /home
  • gconf-editor (configuration)

List Files

ls -Ra  [-R recursive] [-a all] 
ls -ti  [-t sort by time] [-i inode] 
ls -nr  [-n UID & GID] [-r reverse order]
ls -1F   [-1 line by line] [-F */=@|]

File Attributes

ls -l 
d = directory
l = symbolic link
b or c = device block or char
n = named pipe
s = socket
ls –F 
@ = linked_file
* = executable_file 
/ = subdirectory
= socket
| = named pipe 

Directory Usage

du -h | less  (-h human readable)
du -h /home/bob/Downloads/   (dir. in Download)
du -ha /home/bob/Downloads/  (files & dir. in Download)
du -ha /home/bob/Downloads/ | grep -i firefox   (find all instances of firefox and -i ignore case)

Search Locate Find

sudo updatedb
locate /dir/dir | grep file
find -name filename ???

whoami

finger (who is logged in)
id (uid=1000(sjnSUSE) gid=100(users) groups=100(users)
date & cal