Ubuntu :: Shell Script For Searching And Listing?
Aug 17, 2009
How could I give extension as a parameter and then script would take this given extension as parameter and would after that walk through the system and write these listed/ finded files directly to the file like $hostname.$extension.log. I was wondering something like this.
#!/bin/bash
EXTENSION=$1
HOSTNAME=$HOST
HOMEFOLDER=/home/
[code]....
View 1 Replies
ADVERTISEMENT
Feb 23, 2011
I am trying to search particular directory which has files with extensions like .html,.mp3,.xml etc I have a list of such files What I am doing in my script is
for file_name in `find /home/ -name index.html -o -name song.mp3 -o -name help.xml`;
do
if [ $file!='' ]
then
[code]....
I have around 100+ files name with some particular extension , this code works fine if the directory name does not have any special character in it like " "(white character) .
It is failing to give the output. IF I run the find command on the console the I am getting the correct file name with location
/home/user1/public_html/mediawiki/config/movie.mp3
/home/user1/public_html/mediawiki/movie.mp3
/home/user1/public_html/mediawiki/pop.mp3
/home/user2/public_html/index test/pop.mp3
/home/user2/public_html/index test/web.xml
/home/user2/public_html/song.mp3
If I echo the file name from the script Then output is little missed match when a directory name has special char like " "
/home/user1/public_html/mediawiki/config/movie.mp3
/home/user1/public_html/mediawiki/movie.mp3
/home/user1/public_html/mediawiki/pop.mp3
[code]....
I am not sure what is wrong with script or my code .. Does shell have un-controlled behavior of manipulating the output of any command.
View 14 Replies
View Related
Jun 20, 2010
Firefox opens file listing instead of Nautilus opening file listing.When I access a folder via "Places" -> "Home Folder" or "Places" -> "Downloads", Firefox opens and list the contents of the directory.I have re-installed Nautilus, un-installed Firefox and then going to "Places" -> "Home Folder" or "Places" -> "Downloads" launches Nautilus and I can view the contents normally. Anybody else had this problem with Firefox ? Anybody know how to fix this Firefox problem ?Running Ubuntu Desktop 9.10 64bit.
View 2 Replies
View Related
Aug 9, 2010
I have an old Windows XP Media Centre 2005 computer. My sister is the primary user of the computer and she's always downloading viruses and stuff on it so I decided to clean it up a bit and install Ubuntu via Wubi so we could use something that was harder to screw up, easier to use, and faster. I downloaded the iso of Lucid and ran Wubi.The installation worked fine (with the exception of that annoying "no disk" pyrun.exe error, which I had to keep clicking cancel to get out of). I restarted the computer, selected Ubuntu, and Lucid began to install and showed that very well-presented slideshow of Ubuntu's features. It finished, told me to reboot my computer and all seemed well until it reached the boot menu.
When it comes up to XP's boot selector, it gives me the standard list - pick between XP Media Centre and Ubuntu. I selected Ubuntu. Then, it brings me to the GRUB menu. Except, there's no Ubuntu options, just "Dell Recovery Partition" and "Windows XP." I'm positive that Dell Recovery Partition is the factory restore thing since I've used it before, but selecting Windows XP brings be back to XP's OS chooser. It's just an infinite loop until you choose XP from its own OS list.I'm not sure if this has anything to do with it, but a "skip" button appeared on the installation near the end when it didn't appear to be doing anything, so I clicked it. Would that have affected the install?
I've already googled this problem and I've only come across one thread with this problem, and it was from 2 months ago and didn't seem to have a clear resolution. This problem is pretty depressing considering I've used Wubi on two other computers and never ran into any trouble.Also, I would dual boot but I see no problem with using Wubi since it saves a lot of trouble and there's 95% less chance of breaking something (I've been using it for a month or so on my Dell laptop since my preinstalled Windows Vista KSOD'd and I haven't ran into any complications). Plus, I don't have any blank disks or USBs laying around and I'm not waiting 2 months to get a Ubuntu CD.
View 3 Replies
View Related
Dec 19, 2010
I can create a tunnel with the autossh command. Is there a way to view all SSH tunnels created by that command?
View 2 Replies
View Related
Mar 19, 2010
I have set up Ubuntu 9.1 with Samba etc. as a web server. The files are in /var/www and are shared through Samba as web. The root directory and sub directories have index.htm files in them but unfortunately except for the root directory users can see the directory listing rather than the directory automatically producing index.htm. This is obviously causing security problems. How to prevent directory browsing by users coming into the server over the internet by a redirect URL from another site. E.g. [URL] where bigwebsite is a domain registered with a change ip server because I have a service which dynamically allocates an IP Address.
View 3 Replies
View Related
Jan 18, 2011
I've noticed that Ubuntu stopped listing my Windows XP partition in my Places menu like it used to but let it go because it wasn't something I needed to access often. But now I'm discovering that Ubuntu is also not mounting my DVD drive when I put a CD in, nor my USB flash drive that I just reformatted to NTFS using gparted within Ubuntu, nor does any other external USB drive. I don't know how to start with troubleshooting the cause.
View 3 Replies
View Related
Mar 12, 2010
I have used many other distros and just recently started using the Debian based distro Ubuntu. I am used to disabling services using chkconfig. I read this article on how to disable services using
PHP Code:
update-rc.d -f proftpd remove
to disable features but how does one list the services that are running via the CLI like with my CentOS box I run chkconfig --list |grep n and that will show me all that is running on all services so how does one do this with Debian or Ubuntu?
View 2 Replies
View Related
Jan 23, 2010
Is there some low-level way of listing which mouse button does what in Gnome? It seems my middle mouse button is mapped to something besides a middle mouse click (button 3). For example, to move or pan in apps like Xmind or blender, you need to click on hold the MMB. The app will work like expected for a split second then stop, making it useless.
This is one of the most frustrating issues I find with Gnome/Linux/etc. There is a million places to set global inputs, but no place to find them. I have been through every control panel, every compiz plugin, xorg, gconf etc, and can't find what the MMB is set too (or any other input for that matter). I know that somewhere MMB on a window title bar will send it to the back, but can't find where that is either
View 9 Replies
View Related
Mar 1, 2010
I would like to tell apt, "hey, take packageA out of that list, cause I really need it, and I do not want to reinstall it out of fear it may mess up the configuration of that very same package".Anyone know what program and option I would use to accomplish such a task?(couldn't find anything interesting under the `apt-get` command.)
View 3 Replies
View Related
Nov 25, 2010
How would I remove a package in the selections listing in synaptic. Like remove it so no one will see it to install or remove it. Of make a custom filter be what it displayed by default in the selections list. Or set user privelages to not be able to install anything.? But still able to read and write to the hard drive.
View 2 Replies
View Related
Jan 2, 2011
If I runls -R1I get a recursive listing of all files under the current directory.However, if I dols -R1 *.avi, ie I want to search only for files with the file descriptor .avi, I get an errorQuote:ls: cannot access *.avi:No such file or directorySo it seems I am using ls incorrectly. What's the correct way to use wild card pattern matching when using the -R switch? Or maybe that isn't possible?
View 2 Replies
View Related
Jul 26, 2010
I am using ubuntu10.04-server 64bit AMD with fluxbox. After I ran Matlab in a shell (without GUI) the shell does not display characters anymore, but will execute any command, I just can't see the characters that I'm typing.. I use aterm and xterm, does anybody know why that is, am I missing a package?
View 1 Replies
View Related
Apr 14, 2011
Is there any way I can switch my desktop shell from unity to, say, gnome-shell? I can switch using other console shell I like (bash, csh, fish, etc.). Assume that there is a stable alternative desktop shell, I should be able to choose, too.
(For console shell, we goes to /etc/passwd. But for desktop, I can't find the way to config.)
View 2 Replies
View Related
May 12, 2010
Once again, nobody seems to understand security properly when they decide to add nifty new features. After upgrading to 10.04 from 9.10, I now have a listing of all the user accounts under "Switch from" when I go the the logout menu at the upper right side of the task bar. This is a terrible security hole that should never have been allowed in the first place, and is just as annoying as the default behavior of listing all the user accounts on the login screen.
View 5 Replies
View Related
Oct 6, 2010
Just want a very simple directory listing output, no real need for hyperlinks, preferably with a line space between items, that the end user can print out.
I have this code, just don't have the knowledge to make it do what I want.
Quote:
View 6 Replies
View Related
May 26, 2011
how to edit the grub listing that appears during computer boot.
My listing shows 3 OS:-
1. Ubuntu 10.04
2. Ubuntu 9.10
3. Windows XP
I have deleted Windows XP, meaning that my system does not contain Windows XP.
View 9 Replies
View Related
Oct 31, 2010
Is the command "ls -d" meant for only listing directories? Because i tried it and it ALWAYS display just a blue dot. If not what is the correct way to show only directories? I.e. MSDOS equivalent "dir /ad".
View 2 Replies
View Related
May 12, 2011
As stated , gvfs is extremely slow when browsing smb shares.Mount cifs runs in a third of the time gvfs takes.Often gvfs hangs up while listing.I've searched and see tons of noise about it but no real signal.Does anyone here have any info on gvfs as to why it's so slow browsing?"Name : gvfsArch : x86_64Version : 1.6.2"
View 1 Replies
View Related
May 19, 2011
I have want to list sub-directories with spaces but am facing the following problem:
My subdirectories are:
FirstDirectory
Directory with spaces
if I use
Code:
for directory in "`find . -type d`"
[Code]...
View 5 Replies
View Related
Jul 19, 2011
I've plugged a usb stick into my server.
cat /proc/partitions
8 0 1981440 sda
8 1 990720 sda1
8 2 436288 sda2
However when I do:
ls /dev/sd*
/dev/sda
/dev/sda1
/dev/sda2
/dev/sdb
/dev/sdb1
/dev/sda2
I'm sure I got no other devices connected that /dev/sdb would point to
cd /sys/block/sda
[root@footy sda]# ll
lrwxrwxrwx 1 root root 0 Jul 18 16:27 device ->
../../devices/pci0000:00/0000:00:03.2/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0
[root@footy sda]# cd /sys/block/sdb
[root@footy sdb]# ll
lrwxrwxrwx 1 root root 0 Jul 18 16:27 device ->
../../devices/pci0000:00/0000:00:03.2/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:1
What does this imply, sdb linked to sda?
View 2 Replies
View Related
Oct 13, 2010
I presume that if this is possible it would need to be done as root (or as a user who shares root's UID of 0).How can a process be launched so that it does not show up in a ps aux or ps ef or top listing if the command is run by non-root?Is this even possible?The distributions I typically run are RHEL/CentOS and Ubuntu - so if there is a distro-specific answer, that's ok, too.
View 1 Replies
View Related
Sep 3, 2011
Is it possible for a non-root user to hide themselves from the output of who/w, so that they can be logged in without other users seeing it? I think that the file /var/run/utmp might have something to do with this, but it's not writeable by non-root users (permission 644). I'm fairly certain that this can be done by a non-privileged user (because someone told me that they were able to do so), but I don't know how they did it and can't ask them right now.
View 1 Replies
View Related
Jan 21, 2010
I can't seem to find a way to do this, so maybe it's not actually possible, but I was wondering if there was a way to list all files that link to a file.
For example.
touch a
ln a b
ln a c
I want to find out what files link to a (not symlinks, mind you), assuming that this is more complicated (they are spread around to different directories).
I kind of understand about the filesystem storing links in one area and data in another, so I understand it probably takes more work to find a link from a file location than the other way around.
View 1 Replies
View Related
Apr 1, 2010
Here is a good oneI have a folder shared on my Ubuntu 9.1.When I look at it from a Windows XP machine, I can list every file in the folder instantlyWith two different Macs, with Snow Leopard, you will click to open the fold on the mac and nothing happens.The triangle in Finder flips to pointing down but the contenst don't get shown.It looks like if you leave it that way and come back hours later the files are shown.
View 2 Replies
View Related
Dec 29, 2010
How to list all the threads spawned by a process?
View 4 Replies
View Related
Oct 20, 2009
how to do the listing of zip file contents using C?
View 1 Replies
View Related
Oct 3, 2010
list filenames one-per-line, in BASH without including directories. I think he was either wrong or making that up. There is a way to list just the names and one per line but there aren't any arguments I can find that can be used to exclude directories.
Code:
IFS=', '; files=`ls -m`; for i in $files; do if [ -f $i ]; then echo $i; fi; done That does only use ls as a command, however he said his GSI thought he could do it without all that...
Quote:
ricky@ricky-desktop:~$ ls -l
total 1376
drwxr-xr-x 2 ricky ricky 4096 2010-10-02 22:17 Azureus Downloads
drwxr-xr-x 4 ricky ricky 4096 2010-10-02 22:16 Desktop
[code]....
View 6 Replies
View Related
Mar 31, 2011
i want to display all my network card added on my linux box.How do i list them? And how do i acticate them
View 3 Replies
View Related
Apr 24, 2010
I am trying to list udev rules for devices ( similar to lshal ). lsdev is not listing what i want. trying to write udev rule for ALSP touchpad. Upon reading the guide at this site, I am not seeing the ../10_local.rules which is indicated as the correct pat to save user defined udev rules.
Code:
ls /etc/udev/rules.d
Would I be correct in assuming that I save my rule as
Code:
/etc/udev/rules.d/mouse.rule
Device ID:I am confused also as to which device is actually being used! running
Code:
cat /proc/bus/input/devices
i get a return with these entries:
Code:
I: Bus=0017 Vendor=0001 Product=0001 Version=0100
N: Name="Macintosh mouse button emulation"
P: Phys=
[code]....
I have followed howtos as listed here, here, and here. Am I not pointing my mouse.rules to the correct location? Maybe my issue is that I followed howtos from varied sources.the mouse.rules i put in /etc/udev/rules.d/mouse.rules had no effect.
View 7 Replies
View Related