Display command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Display command
# 1  
Old 10-05-2004
Display command

With what command can you list only the hidden files of your home directory?
# 2  
Old 10-05-2004
ok, last one...now start using the man pages, apropos, or a book. Heck, try Google.

ls -a
# 3  
Old 10-05-2004
the command ls -a lists all the files including the hidden file. I'm looking for a command that lists only the hidden files in my home directory.
# 4  
Old 10-06-2004
This depends on exactly what you mean and on your shell. Taken literally,

ls -d .*

will do it. The problem with this is that . and .. get listed as well. Maybe that's not a problem, they are directories, but directories are files too.

ls -d .??*

will avoid . and .. however it also avoids stuff like .x and .y. To pick up filenames that begin with a dot but are not .. you will need a good shell. With ksh:

ls -d .??* .[!.]

will do it. Moving away from ls, here is a command that will work with a low-rent shell:

find . \( ! -name . -prune \) -name ./* -print | sed s=\./==
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk command to display particular pattern

Hi I am using awk to print 10,11 column but it is not displaying required output. Please let me know how I can browse through the line and extract the required one Example: I have below 2 lines in file seq 49960| Thu Apr 19 10:57:40.726182 2018|Len: 89|GAP for CL/U18 9P-NC (CL90U8)) gap... (10 Replies)
Discussion started by: sdosanjh
10 Replies

2. Shell Programming and Scripting

Display command

I was given a question that I can't find the answer within my known commands, it is about a file xxx.txt that contains a character string like "Hello!" and its needed to be printed on multiple lines like: "Hello!" "Hello!" "Hello!" ........ (1 Reply)
Discussion started by: Alexsama
1 Replies

3. UNIX for Dummies Questions & Answers

ls command to display file name

Sorry for the silly question and i could not find anywhere.. I have files in my directory as follows myzip myzip_1 myzip_2 myzip_3 myunzip_1 myunzip_2 I want to display one instance of file name myzip myunzip Thanks Bala (1 Reply)
Discussion started by: baluchen
1 Replies

4. Shell Programming and Scripting

ls command format display

Hi I have 3 files $ ls -l -rw-r--r-- 1 osbadmin osbadmin 427701 Apr 22 12:06 SANITY_TEST -rw-r--r-- 1 osbadmin osbadmin 427701 Apr 22 12:06 Success 123333 -rw-r--r-- 1 osbadmin osbadmin 427701 Apr 22 12:06 Success 123333 (1) I need to see this "SANITY_TEST" "Success 123333" "Success... (6 Replies)
Discussion started by: mnmonu
6 Replies

5. Shell Programming and Scripting

Need a Command To display "echo command value in loop" in single line.

Hi I want to display "echo command value in loop" in single line. My requirement is to show the input file (test_1.txt) like the output file (test_2.txt) given below. Input file :test_1.txt a1|b1|4|5 a1|b1|42|9 a2|b2|32|25 a1|b1|2|5 a3|b3|4|8 a2|b2|14|6 Output file:test_2.txt... (2 Replies)
Discussion started by: sakthifire
2 Replies

6. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

7. SuSE

inconsistent ls command display at the command prompt & running as a cron job

Sir, I using the following commands in a file (part of a bigger script): #!/bin/bash cd /opt/oracle/bin ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out If I run this from the command prompt the result is: 2007-05-16 if I run it as a cron job then... (5 Replies)
Discussion started by: rajranibl
5 Replies

8. Shell Programming and Scripting

what does echo $$ command display

whats the value stored in $$ (2 Replies)
Discussion started by: suri
2 Replies

9. Windows & DOS: Issues & Discussions

Display Printers via command line

Is there an easy way to view all printers on a local machine via command line or a script? I'm looking for the equivalent of clicking on "START, CONTROL PANEL, PRINTERS AND FAXES" to view the devices. I then want to cat it to a file where I would use it later. Thanks (3 Replies)
Discussion started by: gseyforth
3 Replies

10. UNIX for Dummies Questions & Answers

question about limiting the display from the ls command

hey guys im rly new to unix. im attempting to list the 5 largest files in a directory. so i got this far... ls -lR | sort -r and this lists all files by filesize, how can i limit this to only the 5 largest? (4 Replies)
Discussion started by: Aesop
4 Replies
Login or Register to Ask a Question