General :: If Command With -z Option?
Jan 17, 2011Code:
if [ -x /usr/bin/id ]; then
if [ -z "$EUID" ]; then
[code]....
Code:
if [ -x /usr/bin/id ]; then
if [ -z "$EUID" ]; then
[code]....
$ 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
$
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 RelatedI'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]...
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 RelatedI 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.
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?
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.
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 RelatedI have installed Centos in my server and when I take, top -c command its not showing the "command" option correctly. Due to the same, I'm not able to correctly track down the file which causes excessive usage. For eg:
top - 09:30:29 up 72 days, 12:46, 2 users, load average: 0.21, 0.16, 0.15
Tasks: 122 total, 1 running, 120 sleeping, 0 stopped, 1 zombie
Cpu(s): 4.8%us, 0.7%sy, 0.0%ni, 93.5%id, 1.0%wa, 0.0%hi, 0.0%si, 0.0%st
[code]....
how can i copy by script or command files with *.v suffix by "-p" option?
Example:
kuku.ggg
kuku.dd
kuku.v
kuku.vb
only if i try to copy kuku.v by default cp -p will done.
I have the "top" command and I want to override its default behavior for every user, even for future users.
Writing with "W" in top is not an option as my top command somehow overrides the custom behavior per user and always turns to default behavior.
So, what I am asking for is, are there command line switches that override default behavior of top, for example:
Code:
top -<BLABLA>
to show me the load average per core which would be equivalent to starting top first and then pushing the key "1" on the keyboard.
Remember, writing to toprc is not an option for me as top for some reason ignores its config and just goes for default behavior.
Edit: it seems to me this is a bug in the procps package. That is why I updated it to the latest version for my distro CentOS 5.5 and procps to the following [URL] HOWEVER, it doesn't work even now.
my Setup is Fedora 14 x64 + radeon hd 4830 i've downloaded .run package from ati site with latest driver for x64 systems. installed it, but didn't edited grub.conf becouse i didn't understood anything there (probably didn't spent enough time to get things understand) Now i've lost possibility to enter my Fedora system. during boot it lost it's modern blue boot screen (with filling drop), it was replaced by standard old boot screen with triple-color stripe. after this boot screen monitor start blinking going on and off. and on last step i'm getting "Fedora 14 boot bla bla bla something" on screen. nothing works except Ctrl+Alt+Delete. system reboots showing successful daemons shutting sequence. How can i edit grub menu from initial grub screen is it possible to it's own 'e' option or 'c' from grub command line?
View 4 Replies View RelatedDoes anyone know how? I want to add the command line option to the login to. So, I have Gnome, KDE and command line.
View 9 Replies View RelatedDoes anyone know the command line option to show rhythmbox?
Basically I just want to make a shortcut to show the rhythmbox screen as opposed to clicking the icon and selecting show rhythmbox
rhythmbox-client --(option) --no-start
I was making a download option in a script but I cant seem to get the command right
Code:
tar cjf /tmp/file.tar.bz2 --exclude="config" ./
My archive ends up with a file-1.tar in it.
I am not able to print multiple files when using the -#X (number of copies) option using lpr command.
The below is the command that i use :
lpr -#2 -o landscape -o deliver-to=Location -Pmyprinter file-name.pdf
Is there any configuration files that i need to modify for this option to be available ?
The printer that i have is using Postscript driver.
i have created on folder in my server to upload some regular states. I want that user can modify or upload already stored files. but, should not upload any unwanted files orfolders.for that i want to use "rm" command as auto scheduler (putting this in cron tab.so that all files will be removed except some required files / folders for which this upload facility is activated. users are using secure-shell for uploading data.
View 1 Replies View RelatedHow do I add "flush" (or "sync") option to mount command? # mount --flush [what] [where] ?
View 1 Replies View RelatedI know there is a way to do this... What do I need to install to give me this option from the login screen?
View 2 Replies View RelatedI am having memory problems on my old Compaq PC, and am trying to run memtest86+-4.20 to check it. I downloaded the source file, and tried a compile, but had the following problem:
[code]...
how to get around this issue?
I am having a problem with running the mplayer dvdnav option from the command line or terminal. I run the command and this is what I get:
mplayer -nocache dvdnav://1 /media/CDROM /dev/scd1
MPlayer SVN-r1.0~rc3+svn20090426-4.4.3 (C) 2000-2009 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing dvdnav://1.
No stream found to handle url dvdnav://1
Playing /media/CDROM.
File not found: '/media/CDROM'
Failed to open /media/CDROM .....
I went on the forums and they say that some of the packages built to support dvdnav are out of date and that they should be updated. By the way I am running ubuntu 10.04 lucid lynx with lxde as my desktop manager.
I'm using 2 cloned disks with CentOs5.3 and I need to be able to control which one is booted. I can specify which disk in the BIOS but after stage 2 it is always running from disk 2. When I have puppy linux on one disk and CentOs on the other I can boot off of either as selected by the system BIOS so the BIOS is not the issue. I think it is how the root option is passed in the kernel command in the grub.conf.
kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/VolGroup00/LogVol00
I think when the OS searches for the /dev/VolGroup00/LogVol00 share is locates 2 since the disks are clones and uses the last one found. On information I have found for the kernel command and the root option it appears CentOs uses it differently. CentOs uses a volume name as specified /dev/VolGroup00/LogVol00 instead of a partition designator /dev/hda2. Is there a different way to specify /dev/VolGroup00/LogVol00 in CentOS for the root option for the kernel command of grub.conf?
1. Is there a command option to launch an application minimized?
i.e. in terminal
firefox -minimized [URL]
That opens firefox but does not minimize...
2. Also, is there a command option to add the application to the system tray?
use gcc command to compile a *.c file error:unrecognized option '--eh-frame-hdr' why is it? and how to solution it?
View 2 Replies View RelatedI *think* I have used this command before: cp -np source destination
n - noclobber
p - preserve timestamps, etc
I must be remembering wrong because I can't find this "noclobber" option to the "cp" command. What am I thinking of?
I'm using linux suse 9.3. Recently i try to run execution files but it shows an error try running with the option "-console" or "-silent" When I tried with the -console option, I got the error - The wizard cannot continue because of the following error: Invalid command line option: console is not supported (1001) (403)
[Code]...
I'm unable to reset using either the reset option in gnome shell or the command using a terminal. When I select it the shell exits and displays the graphic "exploding" and then it just sits there. Shutdown works fine; just no reset. Any ideas? I've installed from the DVD. I booted the live CD and it resets just fine so I know it's no my hardware
View 1 Replies View RelatedI am using the diff command with the -r option, to compare a large number of files and files in subdirectories. My main interest is to find out which files have been changed, and not what the actual changes are, and since a lot of files has been changed, it would be a lot easier to view the file names only. Is there and option for diff that might do this, or does there exist a similar tool/command that could do the job?
View 1 Replies View Relatedwhile trying to compile grace (5.1.22), I am facing problem:
Code:
$ make
make[1]: Entering directory `/home/rudra/Downloads/grace-5.1.22/
cephes'
gcc -O2 -m486 -fno-common -Wall -Wpointer-arith -Wnested-externs -I.. -
I. -c -o airy.o airy.c
cc1: error: unrecognized command line option "-m486"
[code]...
I am forced to use source because rpm is also giving some problem and crashing while starting.