Programming :: Navigate To Subdirectories In A Shell Script?

Nov 23, 2010

I am having a directory.This directory has a lot of subdirectories which contain html pages and some c source code files,Makefiles etc etc.The script I am trying to write would be executed from one directory which has all these subdirectoriesFollowing is the set of directories and files you can see

Code:
ls
delete.sh lddbus Makefile misc-progs sbull scullc scullp short simple

[code]....

View 6 Replies


ADVERTISEMENT

Programming :: Requesting Shell Script That Only Outputs Directories That Contain Subdirectories?

Jan 7, 2010

I have a directory that has about 5,000+ folders in it and I'd like to run a script that outputs any directory that contains a subdirectory.

View 4 Replies View Related

General :: Get A Shell Script To Loop Through A Number Of Directories And Subdirectories?

Jul 27, 2010

I'm looking to get a shell script to loop through a number of directories and subdirectories,looking for files that contain a particular substring, and renaming the file by replacing the search string with a different substring. For example if you had a directory full of folders that contained digital photos (along with various other files which would need to remain unaffected), and the intent was to remove the "DSC_" prefix from several thousand files buried within. I've whipped up a rather long-winded solution that works well for this purpose but chokes on directory names with spaces. I am reasonably sure there's a 2 or 3-liner that would accomplish this exact same task.

function investigate
{
path=$1
for file in `ls $1`
#for file in *

[code]....

View 1 Replies View Related

General :: Find Files In Subdirectories And Copy Them To Another Directory With The Same Subdirectories?

Nov 18, 2010

This question is very similar to this one except that I want to maintain the file's original subdirectories.

For example if I had

/temp/a/a.txt
/temp/a/a.jpg
/temp/a/b.txt
/temp/b/c.txt
/temp/d/d.txt
/temp/d/d.jpg
/temp/d/e.txt
/temp/f.txt

[Code]...

View 2 Replies View Related

Programming :: Search A String In The Files In The Subdirectories?

Mar 10, 2011

How can I search for a string (for example, a constant) in all the (.cpp) files in the current direcotire and subdiretories.

View 4 Replies View Related

Programming :: How To List Contents Of Directory And Exclude Any Subdirectories

Aug 2, 2010

I'm having trouble figuring out how to list the contents of a directory and exclude any subdirectories.

View 5 Replies View Related

Programming :: Shell Scripting / Create A Shell Script Similar To Ls?

Jun 5, 2011

I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.

Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....

View 10 Replies View Related

Programming :: Bash-shell-like Less Functionality In The Python Shell?

Jun 25, 2010

Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?

Example:

Code:

>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...

I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.

View 4 Replies View Related

Programming :: Prevent "leak" Into Shell From A Customized Shell Menu Script?

Dec 15, 2009

I've created a simple script based menu. This menu will be accessed by only a certain users via ssh.When user logs in, the menu will automatically run. (configured at user's .bash_profile).How do I force the session to close when user hits Ctrl-C or Ctrl-Break ?In a nutshell, I don't want user to have access to shell.

View 11 Replies View Related

Programming :: Shell Programming - Delete User Input

Jan 21, 2011

I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.

Do i have to use sed command?

View 4 Replies View Related

General :: Cannot Navigate Through Ubuntu

Feb 1, 2010

I brought a computer online which is operated by Ubuntu and I know nothing about it. I had an HP printer that I couldn't get to function. I was told that HP didn't have drivers (or something like that) for Linux Ubuntu. I just brought a Lexmark which showed on the box was okay for Linux but when I load the installation disc I can't figure how to get to the "Welcome" screne and follow it through the installation. I do not kow computer terms (a newbie) and will need to be taken step-by-step through the process, if it's even possible.

View 12 Replies View Related

Programming :: Possible To Assist In Programming Shell Scripts?

May 17, 2010

Is it possible to assist in the programming Shell Scripts
Job:
To send a message to the email,All orders written in Terminal or ssh
example : ls , pwd , cat , and other

View 1 Replies View Related

Debian :: How To Navigate As Root With Gnome

Aug 28, 2011

I run a minecraft server on my debian/gnome desktop and I need access to the files in the root folder and to the mysql folder but i cant log as root. i tried installing sudo and it didnt work. i know the su and su - but I want to change the files manually.

View 1 Replies View Related

General :: How To Navigate Certain Directories With Bash

Jun 28, 2011

I'm very new to working with the terminal on my macbook pro and am trying to understand how to navigate into certain directories with it. I can't seem to get out of my username directory. I'm trying to access MAMP/htdocs and get those files into my git repository. I'm new to all of this. I am typing and getting this:
David-Adamss-MacBook-Pro:~ davidadams$ cd Applications/MAMP/htdocs/barcodes
-bash: cd: Applications/MAMP/htdocs/barcodes: No such file or directory
I need to get the "davidadams$" out of that line but I don't know how to navigate out of it.

View 6 Replies View Related

Ubuntu :: Cannot Navigate To Any Webpage When TOR Is Enabled

Oct 25, 2010

Whenever I enable the TOR network in firefox using the torbutton, everything stops working. Clicking on links won't take me to a page. It seems like I cannot navigate to any webpage when TOR is enabled.When I disable it everything works fine.

View 9 Replies View Related

Ubuntu :: Navigate To Dvd Drive In Terminal?

Mar 5, 2011

how to navigate to dvd drive in terminal? what would be the address?

View 1 Replies View Related

Ubuntu :: Navigate Desktop Windows With Keyboard?

Jan 26, 2010

Ubuntu 9.10. I would like to be able to move between several open windows on my desktop with my keyboard rather than my mouseThat is, to change the focus from one window to anotherI can do this with the icons on the desktop by using the up/down/left/right arrow keys on the keyboard, but how to do this for open windows?

View 7 Replies View Related

Ubuntu :: Can't Navigate To Parent Folder In Nautilus?

Feb 5, 2010

I used to be able to open any folder in Nautilus and from there navigate to the parent folder. There was this arrow pointing up that had this function but I don't have the option any more.

View 9 Replies View Related

Ubuntu :: Cannot Figure Out How To Access And Navigate The Documentation?

Mar 14, 2010

I installed openjdk-6 on my ubuntu 9.10 system along the the documentation package and some other, related packages that looked promising but I cannot figure out how to access and navigate the documentation. (This is veering out of the scope of this forum but I also cannot figure out whether I have SJSXP installed or how to acquire and install it in case I do not.) Would one of you be gracious enough to help me figure this out so that I can get started?

View 1 Replies View Related

Ubuntu :: Navigate To The Windows Documents From Within Wubi?

May 8, 2010

I have just installed 10.04 LTS Wubi.The thing is, I can see no obvious way of seeing my files which were created in Windows e.g.Documents, photos etc. How do I navigate to the Windows documents from within Wubi?

View 2 Replies View Related

Ubuntu Security :: Cant Navigate To The Directory To Run The Script?

May 8, 2010

I am having trouble installing root kit hunter. I have downloaded and unpacked the package.It is in /tmpWhen I try and execute the command:

Code:
cd /tmp/rkhunter-1.3.6
I get an error message:

[code]....

View 1 Replies View Related

General :: How To Navigate To Slackware-install Forum?

Jul 6, 2010

how do you navigate to slackware-install forum got there once .now can't find it

View 2 Replies View Related

Debian :: Use Backspace Key To Navigate Back Pages In History

Apr 24, 2011

In windows, using firefox you can use backspace key to navigate back pages in history. Now in Debian - I try and nothing happens. Does anyone know how to change that?

View 10 Replies View Related

Fedora :: How To Install From A .tar.gz - Navigate The Unix Terminal Directory

Dec 23, 2010

Im trying to install net-vi_2.2.1.tar.gz its my understanding that i need to navigate the Unix terminal directory to the either the tar.gz archive or extract the file to a folder and use that as the command directory for the terminal so my first question is how do i use that folder with the terminal? what command do i use?

After that i use the readme or install text file for the rest of the commands i need but im not sure cause ive never installed from tar.gz before

How to install a .tar.gz file ?

View 8 Replies View Related

General :: Use Cd Command To Navigate Back And Forward (like Browser)?

Sep 6, 2011

Is it possible to use cd command to navigate back and forward (like browser)?. Something similar to cd - but it only swaps current and last location. I know I can push dir on stack, it would be great to use cd -> and cd <-, though.

View 3 Replies View Related

Programming :: How To Turn Non-interactive Shell Into Interactive Shell?

Feb 4, 2011

I have a situation where I am in a non-interactive shell. I have tried from within my non-interative shell to spawn an interactive shell but my output still does not goto me. Isn't there a way I can somehow go into /proc or somwhere and make the output my /dev/tty1? Or some way else to remedy this?The situation arises because I drop from my restricted shell environment (a sort of CLI interface), into the actual Linux shell. I cannot change the code of the CLI environment I am just faced with being in the linux shell environment and its non-interactive. Its very annoying to have to put > /dev/tty1 after every command I type.

Not to mention it seems damn near impossible to get pagers like more and less to work properly when your in a non-interactive shell.

View 2 Replies View Related

General :: Navigate To Previous Directory In Windows Command Prompt

Mar 24, 2011

Possible Duplicate: Navigate to previous directory in windows command prompt

Is there an equivalent of Linux's cd - (change to previous directory) in Windows?

View 3 Replies View Related

Ubuntu Networking :: Can't Navigate .conf And Default Route Are Correct?

May 24, 2010

I ask your help to diagnose a problem. For business reasons I use a broadband internet connection via a mobile phone's connected via bluetooth [rfcomm]. Speed is not the maximum but it is more than sufficient for my work. For configuration of ppp I followed this guide Pon pulls up dialup, but I can't navigate also if resolv.conf and default route are correct. In addition I would like to use the NetworkManager that by default, does not see the device. I worked around the problem this way:

I modified the / etc / rc.local so that launch at boot time: # Rfcomm bind yes

After starting Lucid Lynx, bluetooth connects to the phone but NetworkManager does not see the modem.
When I run the connection manually, by: # Pon BluetoothDialup

NetworkManager sees the device, but can not use it because obviously it is locked by the ppp daemon.
So I close the connection with: # poff

Now NetworkManager sees the broadband modem via / dev/rfcomm0, dialup is performed properly. I can finally surf and just enable vpn with NetworkManager. all start automatically at boot, without the need to manually connect and disconnects the dialup to use, finally, the NetworkManager.

View 1 Replies View Related

Ubuntu :: When I Navigate To System Personal File Sharing / Can't Create Share

Mar 27, 2010

I just installed the beta 10.04 LTS with Gnome Version: 2.29.92. I want to to create a network share but when I navigate to system>preferences>personal file sharing I can not create a share. The message indicates that the feature is not available because the required package is not installed. I tried to reinstall gnome-user-share and in reinstalled without issue but I still get the same thing. What am I missing? How can I create a network share?

View 2 Replies View Related

Ubuntu :: Use GNOME Panel Icons With Keyboard (shortcuts, Accessibility, Navigate, Keys)?

May 26, 2011

Surviving without mouse or touchpad I have been looking for this without initial success: only 2 oldie questions like the one I was going to place:
[URL]... But I found it!!: [URL]...

So the key keyboard shortcut is:
CTRL+ALT+TAB

With it you change the focus from the desktop to the panel, and vice versa When the focus in in the panel you can move from icon to icon with TAB (to the right) or SHIFT+TAB (to the left). Then Enter key (sometimes F10 instead) makes the same as left-clicking with the mouse, and SHIFT+F10 makes the same as right-clicking with the mouse. ESC key (sometimes Enter instead) takes the menus out.

There is something about this in: [URL]...

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved