General :: Commands See Files, Bash Doesn't?
Sep 10, 2010
This is a really odd bug I can't seem to figure it out. Basically, commands like ls can see all the files in the current directory, however when I go to execute the file it will give errors like "file not found", even when it most obviously is. If you look at my command history in the screenshot, you can see I can ls into a directory and see it's contents. When I try to run the file, I get the "no such file or directory" error.
However, if I type simply 'vm', I can't use tab completion to complete the directory name, and my third command is me typing 'vm' and hitting tabtab, it lists a bunch of vmware specific tools instead of the subdirectory name. I can then ls and see my current directory contents, and it will list only the single subdirectory. However, then I tried to use the full filepath from root to run the file, still to no avail. If anyone has any insight,
View 2 Replies
ADVERTISEMENT
May 26, 2010
I need to process billions of small files using bash shell commands with limited memory size (256MB). If any of those files contain certain "keywords", the file will be removed. I tried with command:
find . -type f -exec grep -i -l -H "keyword" '{}' + | xargs rm -rf
where all files are located within the current directory. But the command above failed in "out of memory".
View 1 Replies
View Related
Jul 17, 2010
below are the details of my system. I have bash as my current shell, some really common commands aren't working.
Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])
Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$
[Code]....
View 13 Replies
View Related
May 18, 2011
What bash command can I use to rename or change the extension or name of a batch of files (for example, from .php to .html)?
Furthermore, is there a simple bash or python script/command that can be used to open a batch of plain text files one-by-one, search for all instances of a specific word, and replace all of those instances with another word?
View 9 Replies
View Related
Dec 3, 2010
What happens when the script executes is that the ssh connection works and parks me at the remote hosts's shell login. Therefore, the "firefox" command refuses to execute. I need to know how to make the "ssh" connection occur, stay open, and go into the background so that the rest of the script can execute.If I could also do this with the "firefox" line so that the entire term window could be closed would also be helpful.
View 3 Replies
View Related
Aug 1, 2010
I would be running SQL commands (UPDATE/SELECT) from within my bash script. I am completely new to this subject. Is MYSQL used for this purpose? Alternatively, what is sqlplus?
View 6 Replies
View Related
Jul 31, 2011
is there any way I can pass commands to the CLI of a tool directly?
I would like to script some actions, for example:
./OpenBTS < "tmsis"
I do not need to retrieve the results (I watch it in the log file). how I could realize that? There is now way to do this using command line parameters, at least not that I found out. So it looks like I have to figure out sth myself. Maybe I could automate screen in a way to detect the prompt and "paste" my command there. Are there tools for this on Linux?
View 3 Replies
View Related
Sep 14, 2011
Is there any way to list just the folders in a directory using bash commands? ( as the ls command lists all the files and folders )
View 3 Replies
View Related
Apr 28, 2010
I made a script that contains repetitious commands (snmpget and awk are the only ones at the moment. Running these commands from standard terminal work, but when run within a script, I get:
./reg_sm_count: line 10: snmpget: command not found
./reg_sm_count: line 10: awk: command not found
./reg_sm_count: line 10: snmpget: command not found
[code]...
View 2 Replies
View Related
Dec 2, 2010
I'm creating a bash script that contains the following line:"ssh user@$server1 cd /tmp; pwd"What I want is to print /tmp of server1, but the script it isn't printing that
View 2 Replies
View Related
Jan 11, 2011
I'd like to add custom startup commands (for example starting a process, registering to a registration server, downloading a configuration file) to the Linux startup process. Those commands should be triggered on startup only. What is the standard/appropriate way to do this?
EDIT: Is /etc/profile the right place to trigger such things?
EDIT2: I'm using Ubuntu.
View 4 Replies
View Related
May 31, 2010
I wrote a simple bash script to let me treat any set of programs like a deamon. For example if I configure the script a certain way I can start/stop/get the status of apache, mysql and php all from one command. I am having a bit of a problem though. I am passing commands as strings to a function and then depending on the arguments to the script it might run one of these commands or another. Some of these commands need to beun in the background though, such as deluge-web. When I send "deluge-web &" to the function and it execute it deluge-web does not start in the background. I can't figure out why this is. I have tried escaping the & with ''s and with a , but nothing seems to work. I know that this is some idiotic thing that I am overlooking, but I am a bit stumped. Here is the script configured to start/stop/get status of deluged and deluge-web.
Code:
#!/bin/bash
function checkanddosomething {
[code]...
View 3 Replies
View Related
Jan 12, 2010
i want to delete some say 10 previous commands in bash shell!
View 3 Replies
View Related
Mar 13, 2011
$ execute_some_long_command <command is executing> <Accidently press middle button that inserts bunch of garbage (including, for example, `rm -Rf ~/*`) into console>
How to let execute_some_long_command finish, but not execute inserted things?
View 1 Replies
View Related
Jan 21, 2010
I am not a new user of linux but the last time I used linux was five years ago.
I am having a hard time using less. It dont want to accept commands immediately. I need to press 'Enter' to accept the command.
Like if I press 'q' to quit, it will echo 'q' and dont do anything. I have to press 'Enter' to make it quit. Same with other commands.
I am using Windows PuTTy 0.60 with ssh to connect to linux machine.
The linux system is: Linux <removed> 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:19 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
The less version is :
less 394
Copyright (C) 1984-2005 Mark Nudelman
I dont have any problem with vim and more. Only with less.
I have also tried changing the TERM from xterm to vt100. But still the same problem with less.
View 3 Replies
View Related
Jun 23, 2010
I just want to know that how can I execute a example.sh (script) from command-line like other Unix commands. Please write full procedure
View 4 Replies
View Related
May 20, 2011
I have to copy files from HP unix server to SUSE linux server. I have tried rcp, but it does not work. Can someone help me with the commands or files to be changed inorder to copy the files.
View 3 Replies
View Related
Jan 25, 2011
I'm trying to change the bash prompt and based on the man pages $ should show a $ which changes to a # for a SU. However, this doesn't happen on my machine, it's $ for both user and SU.The line in .bashrc is:export PS1="u@h:w$"
View 7 Replies
View Related
Jun 23, 2010
I just want to know that how can I execute my scripts (example.sh) files like other normal commands from command-line. Please describe the full method
View 5 Replies
View Related
Sep 14, 2010
I've found these commands in [URL]:
Quote:
find -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee md5sum.txt
But I don't understand these commands, even after reading their manuals.
View 4 Replies
View Related
Nov 6, 2009
In a couple days I plan on changing to opensuse from kubuntu. Anyway in the Kpackagemanager I removed the pulseaudio client (and its dependencies) and it messed up my system a bit. I don't really mind but all I need is to get my files from my home folder off my hdd to an external through usb 2.0. When Kubuntu 9.10 boots now all it is is a command terminal basically and I don't know the specific commands to get the files. Or if I need to reinstall something so that it boots up with a graphical looking UI again.
View 14 Replies
View Related
Aug 6, 2009
I'm setting up a scheduler to run some bash script commands but they won't run when I point them to a script file. If I change the cron to call
[code]...
If I run ./writeTimeToLog from the terminal - it, well, writes the time to the log file! I then use
[code]...
to test I can schedule this to run every minute just so I can see it working. the entry was a basic as I could make. It adds the cron successfully but never seems to update the file. Where would an error be put if one occurred.
View 2 Replies
View Related
Apr 7, 2010
I would like to be able to connect to a machine, list a directory, wait long enough for me to see the results then move on to the next machine.This is failing:
Code:
#!/bin/bash
while read line; do
[code]...
View 3 Replies
View Related
Apr 25, 2010
want to set more text files. They have "tab" differently (3, 4, 6 or 5 characters space).I have to use "sed" or "awk" sette them in the same tab (for example five space haracters).
View 14 Replies
View Related
Feb 21, 2011
Where are the other BASH commands/exe stored? If the commands are part of the exe of BASH than ls would not be in a path, correct?
View 11 Replies
View Related
Dec 21, 2009
Our CentOS 5 server had a weird issue last Friday. We couldn't run any bash commands, such as ls, vi. It said that it could not find /bin/ls. The only commands we can run are internal commands, such as ps, cd. After we reboot the server, everything is back.
I don't know what's wrong with it. Does anyone give me a explanation?
View 2 Replies
View Related
Mar 3, 2010
I need to launch a bash file in Linux from an unprivileged user session, file that will run bash commands as root. But I do not want to create an user with root privileges to do that.
View 10 Replies
View Related
May 15, 2010
What is the difference between For and While when creating loops in bash scripting?
View 1 Replies
View Related
May 4, 2011
im pretty sure this is a remedial task for many of you but im having an issue with arrays from a shell script being accessed in an awk command. im pretty good with shell scripting but i am embarrassingly unfamiliar with awk. so here's the meat of the script...
Code:
I am trying to take an input file of ip addresses and corresponding netmasks and put it into a format to be loaded onto a juniper switch. the result should look something like this.. x.x.x.x/netmask using the cidr notation. no matter what subnet is provided though, /32 always gets appended to the end of the ip even when it should be /16, /24, etc... also, the cisco part works fine so that doesnt need any attention.
View 5 Replies
View Related
May 5, 2011
I'm trying create script to manage one mysql database, including new db and user creation. But I'm not able get it working when I put SQL commands into function. So I create simple script for testing which is still not working
Code:
#!/bin/bash -x
MAIN_DIR="/admin/mysql"
MYSQL_CNF="$MAIN_DIR/auth.cnf"
MYSQL_CMD="mysql --defaults-file=$MYSQL_CNF"
[code]....
View 1 Replies
View Related