General :: Bash Dirs Command And +N Option?

Feb 8, 2011

I'm trying to use the dirs command with the +N option. The manual says: dirs [-clpv] [+n] [-n]Without options, displays the list of currently remembered directories. The default display is on a single line with directory names separated by spaces. Direc- tories are added to the list with the pushd command; the popd command removes entries from the list. +n Displays the nth entry counting from the left of the list shown by dirs when invoked without options, starting with zero.

dirs -v shows:
0 /dir1/
1 /dir2/
2 /dir3/

However, dir +n 1, dir +N 1, dir -v +n 1, dir -v +N 1 all give:

[Code]...

View 2 Replies


ADVERTISEMENT

General :: Need For Loop To Get Dirs And Run Bash Script

Jul 7, 2010

I have to format 4 years worth of awstats data "static" for a client and then move it to their new server.I don't want to run the commend to do this 48 times. If possible I would like to use a bash script that uses the folders in a directory so the script knows which year-month to do this for me and which folder to place the output in.

View 5 Replies View Related

General :: Command For Listing Files/dirs Recursively Of Specific Directories?

Jul 22, 2011

suppose in my current directory, I have 50 sub-directories. Now, I am interested only in about 20 of those sub-directories (whose names match a pattern). I would like to recursively list the contents of these 20 sub-directories. How do I do that ? I would like to do this in Solaris 10 and Linux(RHEL 5.x).

View 3 Replies View Related

Ubuntu :: Command To View Disc Space Consumption By Dirs?

Jan 28, 2010

I am searching a GUI based "tree view utility" which shows me which directories consume how much hard disc space (cumulative, including recursively the sub directories; including hidden files). Is there such a tool fur Ubuntu/Linux and how do I install it? Is there at least a cmdline command which does the same job in terminal window?

View 1 Replies View Related

General :: Write A Literal Bash Command In A Bash File?

Nov 29, 2010

I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:

Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END

[code]...

View 6 Replies View Related

General :: Bash Command History Update Before Execution Of Command

Jun 7, 2010

Bash's command history is great, especially it is useful when adding the history -a command to the COMMAND_PROMPT.However, I'm wondering if there is a way to log the commands to a file as soon as the Return key is pressed, e.g. before starting the command and not on completion of the command (using the COMMAND_PROMPT option would save the command once the prompt is there again).

I read about auditing programs like snoopy and session recorder like script but I thought they're already too complex for the simple question I have. I guess that deactivating that script logs all the output of the command would lead already in the right direction but isn't there a quicker way to solve that probelm?

View 1 Replies View Related

General :: What Does This Cryptic Bash Command Mean - Why Command Crashes

Mar 20, 2011

Possible Duplicate: What does this cryptic bash command mean? Why this command crashes Linux? :(){ :|:& };:

View 4 Replies View Related

General :: Command To Delete Bash Command History?

May 31, 2010

What's the command to delete bash command history?

View 4 Replies View Related

General :: If Command With -z Option?

Jan 17, 2011

Code:
if [ -x /usr/bin/id ]; then
if [ -z "$EUID" ]; then

[code]....

View 4 Replies View Related

General :: Why Cannot Z Be Last Command-Line Option Used With Tar

Nov 17, 2010

$ ls one.tar.gz
one.tar.gz
$ tar -xvfz one.tar.gz
tar: z: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
$ tar -xvzf one.tar.gz
one
$ tar -xzvf one.tar.gz
one
$ tar -zxvf one.tar.gz
one
$

View 2 Replies View Related

General :: Don't Allow To Add -sport Option In The Above Command?

Mar 10, 2011

i've an issue in a firewall command i hope u help me on.when i try to type the following firewall command:iptables -A INPUT -s xxx.xxx.xxx.xxx -dport 8000:9000 -p tcp -j ACCEPTit gives me:Bad argument `8000:9000`it complaints about the port range and i cant see in problems in that.i also tried to change the order of the options but it never worked.one other thing,why it don't allow me to add -sport option in the above command?

View 1 Replies View Related

General :: How To Find Root Files And Dirs In Some Dir

Oct 31, 2010

For example I have "/some/dir" which contains user's files and directories. I want to check if there are any files or directories of root. I guess I should use "find" command but what's the full command to find it out?

View 2 Replies View Related

General :: Not Enough Hash Marks Of The -h Option Of The Rpm Command

Aug 1, 2010

In the rpm manual, Print 50 hash marks as the package archive is unpacked. Use with -v|--verbose for a nicer display. But actually, there're not enough hash marks when I'm installing a package. About 44 hash marks there...Well, I just want to know where the `50 hash marks' are.

View 4 Replies View Related

General :: Shell Script - Make Dirs Filename

Jun 27, 2010

Trying to write a shell script called make to read a file called dirs with the following in it
programs
scripts
documents
Read file line by line and make the directories in the current directory when you type ./make dirs if no file is given then program should print usage:
make dirs filename

View 3 Replies View Related

General :: Unzip Command: Option To Force Overwrite?

Jan 26, 2010

I am writing a shell script that unzips a ZIP file into an existing hierarchy of files, potentially overwriting some of the files. The problem is that the unzip command asks for confirmation: replace jsp/extension/add-aspect.jsp? [y]es, [n]o, [A]ll, [N]one, [r]ename: y

This is unacceptable for a script.I need an option to force unzip to overwrite the files.I did not find in the man page nor with Google.

View 1 Replies View Related

General :: When Extract The Tarball - Forgot The '-C' Option Of The Command 'tar'

Apr 23, 2010

I tried to install gfortran on my computer. When I extract the tarball, I forgot the '-C' option of the command 'tar', which should be added, according to the instruction of installation.

That is to say, I wrote in the mp directory:

Then, the tarball creates a '/usr' directory under '/tmp' directory, and it contains only a /local directory, which contains only a /gfortran directory.

The thing is, when I modify the name of this directory, for example, from /usr to /usr-modi, I found that the name of the directory /usr under the root directory is also changed from /usr to /usr-modi.

How can I delete this annoying /usr directory under /tmp, without tragically affect /usr under the root directory?

View 4 Replies View Related

General :: Use '{}' To Redirect Output Of A Command Run Through Find's -exec Option?

Jan 10, 2011

I am trying to automate an svnadmin dump command for a backup script, and I want to do something like this:

find /var/svn/* ( ! -name dir -prune ) -type d -exec svnadmin dump {} > {}.svn ;

This seems to work, in that it looks through each svn repository in /var/svn, and runs svnadmin dump on it.

However, the second {} in the exec command doesn't get substituted for the name of the directory being processed. It basically just results a single file named {}.svn.

I suspect that this is because the shell interprets > to end the find command, and it tries redirecting stdout from that command to the file named {}.svn.

View 2 Replies View Related

General :: Pass Option To LILO In Order To Have Script / Command Executed At / After Boot

Aug 28, 2009

I have one distro installed, LILO as the boot loader, and i wonder if it's possible to duplicate the lilo entries with an option which executes some script or command during, or after the boot.Actually, i installed a Slackware + autolaunching virtual machine, but i have two VM, so i need to autolaunch one of them. May i choose it from the very beginning ?

View 9 Replies View Related

General :: Bash Command Output?

Feb 12, 2011

What does the following Shell program do ??: () { :| : &} ; :Warning: My computer got hung when i tried to execute this.Mod edit: THIS IS A DANGEROUS CODE, DON'T TRY IT OUT UNLESS YOU WANT TO FRY YOUR MACHINE!

View 2 Replies View Related

General :: Bash:lex:command Not Found?

Mar 10, 2011

tell me what does error message signify and what should be done to rectify it...bash : lex :command not found

View 3 Replies View Related

General :: Bash Scripts - While And If Command

Mar 10, 2011

I have following BASH script?

Code:
i=0
while [ $i -lt $ARRAYLEN ]; do
if ["$META1" = "$array"];
then
META1FLAG=1
else
META1FLAG=0
fi
let i++
done
While $array contains a word like "start"

When I run the script, In the terminal I either get the response:
myscript.sh: line 3: [: missing ']'
or if $META1 contains the same word "start, I get:
myscrit.sh: line 3: [start: command not found

The purpose of the script is to evaluate a parameter that a user might include when they invoke my script, and compare it to some data that $META1 might contain. If they match I want to set a flag and later launch Xine. If they do not match, I want to set a flag to zero and do something else. I'm a bit lost as to what the responses are trying to tell me in the terminal window when I run this script.

View 8 Replies View Related

General :: Fix Bash \ All Command Not Found?

Oct 23, 2010

I added $PATH=/usr/local/mysql to .bashrc_profile and I guess I wrote it in the wrong place...now when I log in my fedora the terminal says:

-bash: dircolors: command not found
-bash: cut: command not found
-bash: cut: command not found

[code]....

View 8 Replies View Related

General :: Formatting The BASH Command Prompt?

May 6, 2010

I would like to change the formatting on my BASH prompt from this:

anon@machinename.domain.poo:~/some/very/annoying/long/path$

to something like this:

anon@machinename.domain.poo:~/some/very/annoying/long/path
$

The idea is that I would be able to type a reasonably long command on one line without it wrapping to the next line so quickly.

View 2 Replies View Related

General :: Bash: Groupadd: Command Not Found?

Aug 26, 2010

Cannot create a group in RHEL5.

View 1 Replies View Related

General :: Empty Bash Command Line?

Sep 28, 2010

I am looking for a way to delete the currently entered commandline without wasting seconds on the "Backspace"-key.

For example I scrolled the bash history and have a long commandline that would execute when I pressed ENTER:

~$ aptitude search openssl | grep dev

But now I decide that I do not want to execute this command. Can I get an empty prompt fast without deleting the whole line with Backspace? On the Windows "cmd" you can just press ESCAPE and it is gone. This behavior would be what I want.

The question may seem trivial but this is bothering me for a long time now.

View 2 Replies View Related

General :: Pass A File That Changes Name To Another Command In Bash?

Jun 9, 2011

I frequently use wget to download tarballs and zip files from the web, then either untar then or gunzip them. I do:

Is there a way for me to automatically pass the zip file to tar or unzip WHILE wget-ting?

In pseudocode: wget google.com/somfile.zip && unzip

View 3 Replies View Related

General :: Run A Bash Command Automatically On Startup?

May 13, 2011

I was wondering how to run a bash command automatically on startup. on start-up have "alsamixer" or "start-network" executed from terminal.

View 3 Replies View Related

General :: Bash Command To Remove Spaces

Sep 14, 2010

I am reading the output of /proc/acpi/thermal_zone/ATF0/temperature in a program to read my CPU temp. I am using cat like the following:

Code:
#cat /proc/acpi/thermal_zone/ATF0/temperature
temperature: 49 C

I basically want to get rid of the spaces in between temperature and the actual temperature. Is there a command I can pipe the cat output to, to remove the spaces. I have seen suggestions for sed, or tr, but for some reason I cannot get them to work properly.

View 14 Replies View Related

General :: Redirecting Output From A Command Using Bash?

May 10, 2011

I would like to get the command and it's output redirected i have tried using the below but my syntax seems to be incorrect .

<<EOF
$(ls)
EOF

View 2 Replies View Related

General :: [Bash] Send Command To Another Terminal?

Sep 10, 2010

I open up 2 xterms on my desktop, A(/dev/pts/0) and B(/dev/pts/1).I can write from A to B using redirection e.g. echo "test" > /dev/pts/1How do I run a command from A on B? e.g. "clear"Basically I'm putting the 2 terminals side by side, and using terminal B to display the contents of the current working directory, by running the following in A:export PROMPT_COMMAND="ls -a > /dev/pts/1"but this fills up the screen pretty fast. I was actually looking for a way to clear up the second terminal.

View 6 Replies View Related







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