Ubuntu :: Short Key To Command Histroy In Terminal Running Bash?

Jan 20, 2011

In windows command prompt, F8 key can cycle through your previously entered commands i.e say you enter "ping google.com" and then "pushd <dir>". Next when you type p and then press F8 brings pushd and next F8 brings ping command. You can then hit enter to execute the corresponding command i.e ping in this case.Is there anything similar in Ubuntu Terminal running bash? Very handy to get back previously entered commands.

View 3 Replies


ADVERTISEMENT

Ubuntu :: Terminal Bash / -bash: Ls: Command Not Found

Jun 5, 2011

I got a problem with terminal, since i'm really a noob with terminal i don't know how to fix it.Everytime i type in a command it shows for example:

-bash: ls: command not found

Even the basic commands don't work... just cd <directory> and those things works

View 9 Replies View Related

General :: Histroy Command- Not Showing All The History Files?

May 22, 2010

while using history command i can able to see only last twenty histroy commands.

View 1 Replies View Related

Ubuntu :: Bash: Determine If Running In Terminal?

Jul 10, 2010

I'm writing a bash script to move files around based on various bits of metadata. For a few reasons, this script will be run regularly both from the terminal, and from the nautilus-scripts folder ("graphically", if you will). What I'm stumped on is having the script defer outputs based on which mode the script is running in. For example, how can I have the script know whether to echo error statements, or pump them out to zenity based on the method of invocation?

View 2 Replies View Related

Ubuntu :: Bash For Programs Running In Terminal?

Aug 9, 2011

Trying to write a script for desktop launchers that are adaptable to screen resolution. Ideally, the program should:

1. Determine screen resolution:

if "a" use xdotool options window size 1305 x 869 px and move to 135,0
if "b" use xdotool options window size 1545 x 1019 px and move to 135,0

2. Check if program running:

if no, open program, and use "a" or "b" placement options, focus window
if yes, focus window

3. Close script and leave program open (if possible).

Problems arise when trying to use the script on programs that run from and hog the terminal
(e.g. brasero, gcalctool, nautilus)

Here the script will load the program, and nothing else (probably because it still occupies the terminal as it runs)

Code:

gcalctool && xdotool search "calculator" windowmove 135 0

This next command will cause the program to load, move, but it keeps focusing itself like xdotool is running the windowmove function constantly - it keeps focusing itself until script stopped.

Code:

gcalctool & xdotool search "calculator" windowmove 135 0

This had the same effect as the above code, but seems to work as a conditional subscript running when the process is running in the terminal - it just goes infinitely.

Code:

while [1] ; do xdotool search "calculator" windowmove 135 0 done exit

Is there some kind of "if, then" or "while, do" or some kind of conditional I can put in to the script ensure the window is moved only once if the program is running within the terminal? Is there a way to remove the program from the terminal from the script once it's been called?

View 5 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

Ubuntu :: Running A Command In The Alt+F2 Prompt Possible In Bash Scripts?

Jan 5, 2010

Is running a command in the Alt+F2 prompt possible in a bash script?I need this for a launcher for gnome-shell.For it I have written a little script to check if the process gnome-shell is alive and act accordingly.The script works fine, I just don't know how to write "debugexit" to the Alt+F2 prompt, as that is the only decent way I have found to shut gnome-shell down and going back to gdm desktop smoothly.

View 1 Replies View Related

Ubuntu :: Running A Command In Terminal Upon Start Up?

May 14, 2011

I am relatively new to linux but i need to run a command in the terminal so i can prevent wireless power save from happening every time i switch to battery power. I dont really want to go into the terminal every time i switch to battery mode so i want to be able to launch this command upon start up:

Code:
sudo iwconfig wlan0 power off

View 2 Replies View Related

Programming :: Run A Command On A Separate Terminal In A Bash Script?

Apr 6, 2011

I'm trying to do something here:: I'm writing a bash script, I want to [open a new terminal and run a bash command in it] inside the script. I tried to use this, but apparently I get syntax errors.

Quote:

#! /bin/bash
echo "echo Something" > ~/Second.sh
chmod +x ~/Second.sh
xterm -e sh -c ./Second.sh

View 14 Replies View Related

Software :: Running A Zip Command In A Bash Script?

Jul 7, 2010

writing bash scripts (wrote my first one this Sunday) and I'm trying to zip a group of files. It has to be in zip format so alternatives like tar won't work here. I have my script in a folder which has a bunch of Sub-directories in the format "Lab 3" "Lab 5" "Lab 6" etcWhat I'd like to be able to do is take all of the files (just the contents not the folder itself) in the "Lab 3" Folder and put them in Lab3.zip. I'm really close but no matter what I try I keep getting the folders put into the zip file instead of the Folders contents

Code:
#!/bin/bash
LabNum=(3 5 6)

[code]....

View 2 Replies View Related

Programming :: Running Command In Existing Terminal?

Aug 17, 2010

Here's my linuxquestion I have a bash terminal window opened by next command:

Quote:

gnome-terminal -x bash -c "bash"

Now i need to run different commands or scripts AS ROOT in this terminal window from another terminal. I tried things like

Quote:

sudo echo 123 >/dev/pts/4

The result is 123 in that terminal window, but sudo password is asked in my tab where i entered the command.

View 6 Replies View Related

Ubuntu :: Change The Args Passed To A Terminal Command While It Is Running?

Apr 14, 2011

I'm trying to ssh my ubuntu laptop with my android phone. But with the app I have (connectbot) I don't seem to be able to pass any args to the command. I want to pass the -Y command to allow my phone access to the screen on my laptop so i can use my laptop (somewhat) from my phone. Can you change the args passed to the command while it is running?

View 5 Replies View Related

Programming :: Write A Bash Script Program In System Command Terminal?

Mar 22, 2010

I'm trying to write a bash script program in the Linux command terminal that will write to a fellow user and then continue reading down the program. this is what i have (kind of explains the idea too):

#!/bin/sh

clear
echo "this is before the write command"
write jcummins
this message should go to jerry
echo "the message didn't send and this string will not appear"
echo "it appears it has stopped at the write command"

View 5 Replies View Related

OpenSUSE Install :: Running The Hplip Command In Terminal?

Nov 17, 2010

I have downloaded the hplip command on the desktop, attempted to cd desktop, and it shows "no such directory". running this command so I can set up my printer? And I can't seem to put the screenshot here..

View 9 Replies View Related

Ubuntu :: Open A Terminal And Start The 'top' Command To View The Running Processes

Oct 18, 2010

When I open a terminal and start the 'top' command to view the running processes, in the summary view I get 4 users. I guess that in addition to my account the root runs in the background but who are the other 2??

View 1 Replies View Related

General :: Disable The Terminal Beep When Running The Shutdown Command?

Sep 3, 2009

I've used the following script here: [URL] to upgrade Alsa to 1.0.21 in Ubuntu 8.04. Now whenever I run:

Code:

sudo shutdown -h <time> or sudo reboot from the terminal I get a rather annoying beep sound. What's even more annoying is if I use the shutdown command to specify a time I get a beep every 10 minutes or so.
I've tried disabling the terminal beep in the terminal profile, disabling the beep in System/Preferences/Sound, adding "blacklist pcspkr" to /etc/modprobe.d/blacklist, and running gconf-editor from the terminal and setting /desktop/gnome/peripherals/keyboard/bell_mode to 'off' rather than 'on'.

View 6 Replies View Related

General :: Short Cut To Copy From Terminal Output?

Dec 10, 2010

if we type a command such as "locate somefilename" in the terminal we will get all the paths to the file name as output. If i want to copy only one line from that output how do i do that without using mouse?i need terminal short cut to copy one line

View 8 Replies View Related

General :: Creating Some New Short+keys For The Terminal?

Feb 1, 2010

I did something stupid; I think while creating some new short+keys for the terminal, I must have enabled an unknown feature to me. The keypad now acts like a mouse. For example; With NumLock on, I press 7 the mouse goes north+west. I press 6 the mouse pointer goes east.

View 2 Replies View Related

General :: Make A Bash Script Keep Running In Same Terminal After It Calls Second Script?

Jun 25, 2010

I have a startup script for jboss (start.sh) that sets some JAVA_OPTS and then calls bash run.sh.If I run it (start.sh) from the command line it runs in the terminal fine. If I make a shortcut launcher for it in gnome and set it for 'application in terminal' it pops up then immediately dies after launch.Not sure what the problem is. Is this not working because one script is calling a second script? But then why does it work when I call ./start.sh?

View 4 Replies View Related

Ubuntu :: Short Path On Command Line?

Mar 1, 2011

I have a quick question: how can I make the path short on the console? My problem is that if I descend 10 levels in a directory tree, the path becomes so long that it takes more, than one line of the console window. Is there a way to shorten it, and show only the name of the current directory, without the whole path, i.e., instead of

Code:
v923z@penguin: first/second/third/fourth/fifth/sixth/seventh/eighth/ninth/tenth>
only

[code]....

View 3 Replies View Related

Ubuntu :: Short Specification Of Root Director For Copy Command

Jan 18, 2011

I would like to copy a file from some random folder and send to a "Test" folder in root directory. But I havn't found how to specify the root directory without using ../ until i reach the root directory.i.e. suppose I'm in my random folder where I want to copy my file sudo cp somefile.txt (root???)/Test

what do i put for root?Just as additional explanation, if I have a Test folder in my home directory that i wanted to transfer to, then i could simply do cp somefile.txt $HOME/Test.

View 2 Replies View Related

General :: Command For Short File Descriptor?

Jun 25, 2010

the short file descriptor of an ISO file. I have been assigned with a task to match the short file descriptor of an ISO file(to be provided to the customer) to check if thats "Kudgo Support tools" or not.What linux command should I use?

View 6 Replies View Related

Programming :: Keep The Bash-script Running If "exec Command" Fails

Aug 13, 2010

Is there a way to use exec, but if exec fails to go on with the script?

Example:

Code:
#!/usr/bin/env bash
exec startx
echo "Starting of X failed"

If startx fails, the echo will be seen on the screen. I tried all kind of stuff, but guess it ain't of much use to post it here. I searched the web, but searching for "exec and bash" in one sentence does give results which are not what i am looking for.

View 6 Replies View Related

Ubuntu :: Short Cut Keys Seem Not Ot Be Working - Ex Alt +F2 Dose Not Open A Pop Up Command Line

Apr 29, 2011

Some of my short cut keys seem not ot be working. Ex Alt +F2 dose not open a pop up command line. Also would like to add some short cuts. Like Ctrl + Alt+ Backspace for reboot. I went to the short cut app and I can add a short cut key, name it, but can't seem to figure out how to assign it a function. Didn't seem intuitive to me. I'm using the UNE version on a asus eel 1000.

View 1 Replies View Related

Ubuntu :: Bash Broken, Lost Functionality In Terminal (gnome-terminal)?

Dec 10, 2010

Linux-goers. I did some research on this, but I am still fairly new to Linux. In Ubuntu 10.10 (Maverick), I accidentally overwrote my "/bin/bash" file. Dude, using "sudo" with a small typo can work disasters. Bash is now broken in the Terminal (gnome-terminal). Terminal itself still works fine, technically, but bash is still hosed/broken. Here is what I did to try to fix it: Booted from Ubuntu 10.10 live CD. Mounted my Ubuntu partition and manually copied the good/fresh "bash" file onto my hard drive. Verified copy was successful. Didn't help, as you see. Reinstalled "gnome-terminal" using synaptic package manager. Tried to reinstall bash via synaptic, it failed with error, "E: /var/cache/apt/archives/bash_4.1-2ubuntu4_i386.deb: subprocess new pre-removal script returned error exit status 2"

In Terminal, all basic commands work as far as I can tell. ("ls", "pwd", navigation, etc.) Here are some problems:My "username@computername" does not display in the prompt; only the $ sign. Bash keyboard shortcuts such as uparrow and tab do not work. Instead, each inserts a key code. I can't even move the cursor left/right. Aliases (a function of bash and .bashrc) are broken, of course. My sanity level decreases when I use Terminal now. For what it's worth, even with "sudo" I get a "permission denied" error when trying to run Google Chrome! I read something about a ".bashrc" file being a possible problem, but I don't know how to make it work, or the file's proper locations in Ubuntu 10.10. Is there something I can do with a "make" or "apt-get install" command or something?? Could this simply be a permissions problem? Is the link to "/bin/bash", "/bin/sh", or a ".bashrc" file broken? Guide me, oh Linux gurus.

P.S. I always wondered what exactly bash was and how it was different from the basic terminal. LoL, this is an excellent way to demonstrate the difference, and I WANT IT BACK!

View 9 Replies View Related

Ubuntu :: Command Line (write A Short Script That Will Compress A Specific Folder) - 7zip

Oct 6, 2010

i need to write a short script that will compress a specific folder that`s on the Desktop (and all it`s content) and also will encrypt it with a password that is inside the script --->meaning it wont ask for a password+verification when compressing+encrypting

View 1 Replies View Related

General :: Getting LESS To Return Back To Command Line If A Short File Is Displayed

Aug 12, 2010

Is there a command line option that will allow less to return to the command line if there are not sufficient lines in the file to warrant paging.

View 1 Replies View Related

Ubuntu :: How To Clear Empathy Chat Histroy

Jan 12, 2011

I'm an Ubuntu user and I always chat on Yahoo, MSN, Gtalk and Facebook accounts using Empathy (with the fact that there is no better alternative; pidgin is heavy for me). I have noticed long earlier that all the chat histories are saved. However, just today I discovered that I couldn't delete those histories. Hitting the clear option from the right click fly out menu doesn't permanently remove the history. I can see them again when I try to look for previous conversations.

I believe there is a way to permanently remove chat histories from Empathy.

View 5 Replies View Related

Debian :: Change Dragora Bash Terminal To Default Jessie Terminal

Feb 29, 2016

I mainly use debian jessie , recently i have installed daragora as my second os to get a feel of gnu/linux . the problem is that dragora uses bash , and it's commands are different from debian jessie terminal is there a way that i can use the same commands here in dragora?

View 4 Replies View Related

Programming :: CURL In Bash - Error "Upload Is Disabled During Short Maintenance Work (ETA 10 Minutes). Brb"

Mar 7, 2010

i'm trying to write a bash script to upload an image to [URL], but i can't get i working properly. Everytime i try, the html returns me a error saying "Upload is disabled during short maintenance work (ETA 10 minutes). Brb!", while from the browser everything works fine. This is my current command line:

Code: curl -L -b cookie-pix.txt -c newcookie.txt www.pixhost.org/cover-upload -A "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" -F 0=@/home/admin/Desktop/karm.jpg -F content_type=0 -F press=Upload And this is the html of the form:

[Code]....

View 1 Replies View Related







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