General :: 'cd' Command Increases Size Of Shell Propmt?

Sep 10, 2010

When i change the directory using 'cd', the length of my shell prompt keeps on increasing. To make it more clear kindly see below

Code:
$> cd MyWorks
$ Myworks> cd Shell

[code]....

View 8 Replies


ADVERTISEMENT

General :: Creating Tar : Shell Vs Ui, Size Differs?

Oct 14, 2010

In a shell script, I am creating a .tar using this command

Code:
tar -zcvf dst/lib/library.tar.gz dst/lib
There are two problems:

[code]...

View 1 Replies View Related

General :: Shell Script - What Does Dollar Size Mean

Jan 23, 2010

I am trying to learn shell scripting. What does the dollar sign mean, and these signs {}
DEST="${DST}`date +%F`/"

View 11 Replies View Related

General :: Shell Script To Find A File Size?

Jul 20, 2010

am trying to write a shell script to find the size of a particular log file and if the log size grows, script should mail the changes to the administrator or a any user so script should monitor the log file continuously in a time interval, how can i do that?

I tried with these codes to find the file size but it throws me error says command not found

$s=$( stat -c %s mylogfile.log)
echo $s

View 10 Replies View Related

General :: Log Files - Increases - Get Automatic Email Alert

Mar 10, 2011

Is there any way to find out log files increases we will get automatic email alert. for example if the log file size is 2 MB once the file exceeded 2MB then we will get email alert. is there any script.

View 5 Replies View Related

General :: Evaluate Size Of Output Command?

Nov 18, 2010

I'm trying to do something like this:

Code:
#!/bin/bash
cmd1=$(cat /var/log/messages | grep -e 'blocked for more than 120 seconds' | cut -c 55-62)
if $cmd1 != 0; then echo 'okay'; fi

however i'm messing up somewhere... bash attempts to evaluate the elements in cmd1. when I try to run this script it complains saying:

Quote:

test1.sh: line 5: blocked: command not found

I am open to alternatives. My intent is to replace cat /var/log/messages with dmesg, so I can attempt to determine if a problematic application I use encounters a blocked state (unresponsive for more than 120 seconds).

Should I be using a different test condition? I tried something like:

Code:
# this declares cmd1 as an array
cmd1=($(cat /var/log/messages | grep -e 'blocked for more than 120 seconds' | cut -c 55-62))
#attempt to determine if number of elements in array is greater than zero
if ${#cmd1[@]} > 0; then echo okay; fi

But I get the same error... what am I doing wrong?

View 3 Replies View Related

General :: Bash Command For Getting L2 And L3 Cache Size?

Sep 4, 2010

How do I get the L2 and L3 cache size?

View 4 Replies View Related

General :: Finding Folder Size Using Command

Oct 26, 2009

I want to know is there a command to find size of a folder.

View 4 Replies View Related

General :: Run A Shell Command With &?

Jun 15, 2010

I am using Red Hat Linux Enterprise version 5. I've noticed people sometimes running commands with a couple of & options. For example, in the below command, there are two & signs. What is the purpose of them? Are they always used together with nohup?

nohup foo.sh <script parameters> >& <log_file_name> &

View 6 Replies View Related

General :: Show Size Of Folder Contents In Ls Or Some Other Command

Sep 29, 2010

I know these folders each have >80gb of files. Yet, they only show 4.0K in ls -lah? How can I have ls show size including the contents?

[root@aapsan01 aapxen01]# ls -lah
total 48K
drwxrwxrwx 6 root root 4.0K Sep 29 03:45 .
drwxrwxrwx 15 root root 4.0K Sep 27 09:15 ..

[Code]....

View 4 Replies View Related

General :: 512KB Maximum Transfer Size Per Command?

Apr 7, 2011

I'm using fc14 and the SG driver to test some SCSI (SAS) targets. In doing so, I'm bumping up against what appears to be a 512KB maximum transfer size per command. Transfers up to 4MB sometimes work, but often they result in ENOMEM or EINVAL returned from the write() function in the SG driver. I could not find any good documentation on how the SCSI system in Linux works so I've been studying the source for drivers in drivers/scsi.

I see that there is a scsi_device struct that contains a request_queue struct that contains a queue_limits struct that contains an element called max_sectors. The SG driver seems to use this to limit the size of the reserve buffer it is willing to create. I see that there are several constants used to initialize max_sectors to 1024 which would result in the 512KB limit I see (with targets having 512 byte sectors). At this point I have several questions:

1) When the open() function for the sg driver gets called, who initializes the scsi_device struct with the default values?

2) Can I merely change the limits struct to arbitrary values after initialization and cause the SG ioctls to set the reserve buffer to allow greater values?......

View 2 Replies View Related

General :: Command Line Options - Listing MP3 Over Certain Size

Jan 6, 2011

How would I list every mp3 over a certain size on an entire hard drive?

View 1 Replies View Related

General :: Difference In Size Of The Tarred Files After Archiving Using Tar Command?

May 17, 2011

i am using red hat linux 2.4 . I have 3 folders dir1 dir2 dir3 I have tarred them like this.

1.tar cvfz tarball_1.tgz dir1 dir2 dir3

2.tar cvfz tarball_2.tgz dir1 dir2 dir3 2>& /dev/null (So that it does not display any error message or operation details to the user)

[usr@machine]$ ls -lrt
-rw-r--r-- 1 usr grp 199843988 May 17 13:39 tarball_1.tgz
-rw-r--r-- 1 usr grp 199837488 May 17 13:53 tarball_2.tgz

But can any one explain the size difference as seen in list output...

View 4 Replies View Related

General :: Display True File Size Using Ls -l Command In CentOS

Apr 19, 2011

I am trying to figure out the actual size of files and directories on a CentOS Linux 5 server and when I do a ls -l I see for example at the Directory of /Data 4096 but once in side the directory and I do a ls -l I see larger file sizes. How do I get the actual file size of a Directory to show up?

View 3 Replies View Related

General :: TIP: Reducing PDF File Size From The Command Line With GhostScript (gs)?

Jan 14, 2011

I've spent hours trying to scan + shrink a multipage PDF documentlosing readability. This is the first time I've ever needed to do this! (I had to scan each page as ".jpg" in order to email and open on another computer, so I could not scan to PDF directly, which I think is why each page was so large; lower DPIs made the text too blurry.)I found this great tip on UbuntuGeek...but anyone can do this if GhostScript is installed:

View 1 Replies View Related

General :: Looking For System Shell Command?

May 31, 2011

I'm looking for a specific command,if it exist... i want to login from my server to another Linux server,but the question is: can i do it in a one line command for ex:
usually you type: ssh "user"@10.1.1.1 and then the password,but I'm looking for a command in one line a fake ex: ssh user@10.1.1.1 -p "password" something like that.
I don't know if anyone of you understand what do i want to say .

View 6 Replies View Related

General :: Shell Command To Let System Box Go Sleep?

Jun 21, 2010

I'm writing a shell script to check the I/O activity of a Linux box and if the server is quiet for a certain long time, the script should let the server go to sleep. But, after some Google searching, I didn't find a answer yet. Is there a shell script command to put a Linux box to sleep?

View 3 Replies View Related

General :: Executing A Shell Command In Emacs?

Dec 17, 2010

I tried to execute a shell command by M-! cmd RET but it did not work.M-! does not turn up in the microbuffer no matter how many times I press Alt+!.But if I go to Tools menu and select Shell Command... option then it writes M-! to the microbuffer and everything works fine.What is the problem here?

View 2 Replies View Related

General :: Triming Lines Using Shell Command?

Mar 22, 2011

i have a text file generated automatically from a script , but the result in the script is not ordered in a readable way, so i need your help to fix it using a shell command the text file contain data in this way :

Code:

0.147361 0.243688 0.081520 -0.446603 1.130529 NC_000846 Chordata
Rheiformes
Aves
0.091740 0.379224 0.021160 -0.088493 3.441356 NC_000857 Arthropoda
Diptera

[code]....

i want to arrange the data in this text file in a way that each line will concatenate the 2 lines after it , so that will be 1 line , i want all the lines to be treated in this way ,

View 2 Replies View Related

General :: Backslash Preceding A Shell Command

Mar 21, 2011

Reading a BASH script, I saw a find command preceded with a backslash. It was similar to this:

Code:
`find . -type f -name '*.xml' -print > xmlfilelist`

It's impossible to find documentation about this in man pages or on the internet, since 'backslash' are always evoked along with special characters. I also noticed that even though the command was surrounded with backquotes, the result was not affected to any variable. Maybe the backslash's presence is related with this?

View 2 Replies View Related

General :: Create The Shell Which Would Support The LS Command In C++?

Sep 4, 2010

I would like to create the shell which would support the LS command in C++. And any way to change the command prompt.

View 1 Replies View Related

General :: Creating A Shell Using C Which Could Implement LS Command

Sep 4, 2010

I would like to create the shell which would support the LS command in C++. And the way the command prompt can be changed.

View 7 Replies View Related

General :: Shell Command To Display Contents Of A File?

Feb 23, 2010

shell command to display contents of a file? Like that of .txt or .html

View 9 Replies View Related

General :: Pipe Output Of Shell Command Into A New Buffer In Vim?

Jun 29, 2010

How can I pipe the output of a shell command into a new buffer in Vim? The following obviously wouldn't work, but you can see what I'm getting at:

:!echo % | :newtab

View 2 Replies View Related

General :: Make A Shell - Using Mail Command DestMail= Cat

Jul 22, 2011

I have a problem to make a shell, using mail command DestMail= cat /opt/scripts/maillist.txt mail -s"SUBJECT" $DestMail -- -r xxxxx@gmail.com < /opt/scripts/test.txt where: maillist.txt contain email adresse separated by comma test.txt mail text this script can eval DestMail variable!!

View 1 Replies View Related

General :: Want Shell Command Amount Space In Disk For Mp3

Jun 25, 2010

We use a SLES 10 SP2 file server. This file server has all type of files. We want to know what is the amount of space used by mp3 files. What we need to know is the total space in disk of mp3 files. I've been testing du command, and find command, but with no satisfactory results. Does anybody know how to do this?

View 11 Replies View Related

General :: Clear Screen Command For BASH Shell

Jan 21, 2010

I am unable to use clear or cls command on bash shell. I have recently installed Cygwin and am using that for practicing unix commands.

I see that I can use Ctrl + L to clear the screen. I created an alias in my .bashrc to do the same as
alias cls='^L'

This is how i defined other aliases e.g.

And they work. Hence I assume cls will work too but this is what I get when I try to give cls on command prompt. Am i missing something? Is there a way to do this?

Then someone suggested, You cannot alias keystrokes to commands or vice versa. You could just alias cls to an echo command: echo -en "x0c"

And I added the following to .bashrc,

Sourced the .bashrc file. No errors but cls still does not clear the screen. Infact when I typed the echo -en "x0c on command prompt as well, nothing happened. What does this command do?

View 3 Replies View Related

General :: Use Ssh And Run Command In The Remote Machine Using Shell Script?

Apr 27, 2011

How can i do that.. Today is my first day writing a script.. and correct me if this Thread should be somewhere else..

Code:

if [ $1=$anyvariable ]; then
ssh www.a.com <Have to set few variables and give commands >

View 8 Replies View Related

General :: How To Visit URL Using Shell Script Or Unix Command

Aug 2, 2011

I want to visit a url but this shall be invoked by a shell script. Anyone let me know the command to hit a url in unix.

View 5 Replies View Related

General :: Building Application In Shell Using Make Command

May 26, 2011

Consider that I am building my application in Linux shell using make command but somehow the build fails. Is there any way I can find out that the build has failed (of course looking at shell for error messages will do the job for me but I don't want that). Is there any flag make or shell will set/reset if such failure occurs ?

View 5 Replies View Related







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