I have set my PS1 variable in .bashrc to be the following:
PS1='\e[35m[\W]:\e[0m '
It achieved what it was intended to (change the color of the prompt which displays cwd inside [] and before :), but when I search through my command history, sometimes parts of commands that I cycle over become attached to the prompt.
I have this command succession:
echo -ne "/dev/shm/test.sh" | netcat 89.196.167.2 4567
and let's say it return a string like, for example "Hello...bla".
(on the 89.196.167.2 i have made a server that takes ssh comands and executes them and returns the result to the client, and it is running ok, it return what i need, so this is not the problem)
I want to put this returned value, "Hello...bla",
I am getting different output with the 'tr' command in bash
I am using
Linux:
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
Bash version:
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Code:
$ x=`echo XXx | tr '[a-z]' '[A-Z]' `
$ echo $x
XXX
$ y=`echo XXx | tr [:lower:] [:upper:] `
$ echo $y
XXx
On the bash command-line, ↑ gives me the previous command. On the command-lines in numpy or matlab, when I type a few characters, ↑ gives me the previously entered command starting with those characters. How can I enable exactly this behaviour in bash?
I am aware of more advanced ways of searching through the command-line history, but sometimes a simple way is more convenient.
I'm using this command to get my last typed command:
history | cut -c 8- | tail -n 2 | head -n 1
It works very well in bash, removing the line numbers, but there is one problem I have with it, (er, annoyance, because I want just the command) and I'm piping this to the xsel clipboard manager:
It also grabs the trailing new line / carriage return...
I know in some shells you can use:
echo "tex
CLI Companion is an application that is used as a compliment to the Linux Terminal. People unfamiliar with the terminal will find CLIcompanion useful to become acquainted with the terminal. Using the built-in commands you can unlock the potential of the Terminal. Experienced users can use CLIcompanion’s add command feature to build a command dictionary.
Hi all,
1). Is is possible to use the date builtin and subtract a literal e.g 1 day in bash alongwith the find command from the command line:
e.g
Code:
find . -name --date %Y-%m-%d - 1
2).
Synopsis
echo [-neE] [arg ...]
Description
echo outputs it's args to stdout, separated by spaces, followed by a newline. The return status is always 0. If the shopt option xpg_echo is set, Bash dynamically determines whether echo should expand escape characters (listed below) by default based on the current platform.
The average linux users use the terminal commands for many tasks and some certain commands are very frequently used. For example, if you are a user of Ubuntu, you have to type " sudo apt-get install" every time you want to install a new package or the command "xset dpms force off" to turn off the desktop/laptop monitor.