LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 12-23-2011, 09:16 AM   #1
kiwizzle
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Rep: Reputation: Disabled
Help for a newbie?


Hello there.

I got a few probably easy questions, though I can't seem to make it work ;p

in ubuntu, how do I create a file in, lets say "/tmp/scripts", that contains a list of all filenames in the directory /bin that end wih s or t?

also how do I change permisson of a file to, lets say, r-xrwx---?

I'm fairly new to Linux and just looking around for basic knowledge that could proove usefull.

regards. Kiwizle
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-23-2011, 09:23 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
Hi

Code:
ls /bin | egrep "*.[ts]" > /tmp/scripts/file

When it comes to permissions, have a look at this tutorial:
http://www.comptechdoc.org/os/linux/..._ugfilesp.html

Last edited by sycamorex; 12-23-2011 at 09:52 AM.
 
2 members found this post helpful.
Old 12-23-2011, 09:30 AM   #3
jhw
Member
 
Registered: Apr 2010
Posts: 83

Rep: Reputation: 32
Quote:
Originally Posted by kiwizzle View Post
in ubuntu, how do I create a file in, lets say "/tmp/scripts", that contains a list of all filenames in the directory /bin that end wih s or t?
One way to do this would be a combination of 'ls' and 'grep':

Code:
ls /bin/ | grep s$ >> /tmp/scripts && ls /bin/ | grep t$ >> /tmp/scripts
Quote:
Originally Posted by kiwizzle View Post
also how do I change permisson of a file to, lets say, r-xrwx---?
You can use 'chmod' for this. Best would be to read the manpage, but for your example it would be:
Code:
chmod 570 $filename
 
1 members found this post helpful.
Old 12-23-2011, 09:43 AM   #4
kiwizzle
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the advice
 
Old 12-23-2011, 09:54 AM   #5
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
Glad to be of help.
If you think that your problem has been solved, please mark the thread as read (in the thread tools)
 
Old 12-23-2011, 10:06 AM   #6
kiwizzle
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Also, is there any command to see which filesystems are installed?
 
Old 12-23-2011, 10:11 AM   #7
jhw
Member
 
Registered: Apr 2010
Posts: 83

Rep: Reputation: 32
If you just want to know, which filesystems are currently mounted, use the 'mount' command.
 
Old 12-23-2011, 10:20 AM   #8
kiwizzle
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
allright, but lets say I want create an alias that will display the last 5 mounted filesystems, any advice?


just trying to make things tricky for myself to learn some ;P
 
Old 12-23-2011, 10:26 AM   #9
silent
LQ Newbie
 
Registered: Sep 2011
Location: The road from nowhere to elsewhere
Distribution: Gentoo Linux
Posts: 14

Rep: Reputation: 3
I think 'mount' lists them from 1st to last
Just do
Code:
mount | tail -n 5
 
1 members found this post helpful.
Old 12-23-2011, 10:38 AM   #10
kiwizzle
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the help, lads
 
  


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
[SOLVED] apache newbie/mrtg newbie (newbie to everything) new2nagios Linux - Software 3 12-14-2009 10:05 AM
security newbie, but not Linux newbie. advice on secure delete tools mattie_linux Linux - Security 19 08-15-2005 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:06 AM.

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