LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-13-2010, 07:23 PM   #1
bn48
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
Question list command question


What is the list command that will display every directory and filename that begins with "BN" including hidden files?
 
Old 02-13-2010, 07:33 PM   #2
bret381
Member
 
Registered: Nov 2009
Location: Alabama
Distribution: Arch x86_64
Posts: 650

Rep: Reputation: 78
you will have be root

Code:
su
cd /
ls -R | grep "BN" | less
 
Old 02-13-2010, 11:40 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Alternatively, as root
Code:
find / -type f -name 'BN*'
If you are only interested in files accessible to the current user then
Code:
find / -type f -name 'BN*' 2>/dev/null
The 2>/dev/null suppresses error messages about find not being able to read some parts of the file system(s).
 
Old 02-14-2010, 04:55 AM   #4
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,363

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by bn48 View Post
What is the list command that will display every directory and filename that begins with "BN" including hidden files?
Code:
cd /
Code:
ls -Ra | grep ^BN
Now check everyfile start with BN will be displayed .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the command to list users? neo_in_matrix Linux - Newbie 24 02-12-2014 11:43 PM
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 08:19 PM
Command to run another command against a list of files psweetma Linux - General 3 11-09-2005 06:29 PM
command to list threads minil Programming 1 01-10-2005 06:43 AM
Command to list some files? AoiSora Programming 13 10-29-2003 05:37 PM


All times are GMT -5. The time now is 08:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration