Tag Info

Hot answers tagged

15

The likely cause of this problem are ANSI Escape Codes. These allow scripts to change the foreground and background color of the terminal. You can even mimic the colors of the screenshot above by running the following command: echo -e '\E[32;46m' To reset the terminal colors, use the following command: tput init According to the manpage: init If ...


6

This will do: PS1='\u@\h:$( case $PWD in $HOME/xxx/yyy/zzz/src) echo "datasource ;; *) echo "\w" ;; esac )\$' That gives you the flexibility to define other special directories as well. Aliases won't help you here. To reduce duplication, put all your special dirs in an array, and use that to generate your aliases and also your ...


4

First set the world "Terminal" to appear in the window title of your gnome-terminal. To do this, when you are in gnome-terminal go to Edit → Profile Preferences, select Title and Command tab and be sure that the field Initial title contain the word "Terminal": Second, add a new custom keyboard shortcut for the following command: bash -c "[[ \"$(cat ...


4

Your question isn't very clear but if by "archive" you mean a compressed file (such as zip) then perhaps this answer will help? How to mount a zip file as a file system? After mounting the archive you would be able to cd into it.


3

The help builtin can be useful even for the { keyword. From help -m {: NAME { ... } - Group commands as a unit. SYNOPSIS { COMMANDS ; } So, the semicolon (;) is mandatory after each command.


3

To exec or not to exec a call to exec replaces a shell's data, and therefore the shell can't return from an exec system call. But not every command is the name of a program to execute. So often there is no exec call involved. The key distinction is that in contrast to ( cmd1; cmd2; ), you don't get another shell process. Or perhaps more correctly, the ...


2

The kind of output you are showing is normally due to a stuck key on your keyboard, you can test by using another one. Specifically, the ^[[2~ sequence is sent by Insert. So, you almost certainly have that particular key stuck. You can try cleaning the Insert key, you can take the key cap off and clean behind it. If cleaning makes no difference, you will ...


2

To keep the tab titles you need to comment the following lines in your .bashrc: # If this is an xterm set the title to user@host:dir #case "$TERM" in #xterm*|rxvt*) # PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" # ;; #*) # ;; #esac Then gnome-terminal --tab -t "X" -e "bash" --tab -t "Y" -e "top" will work as expected:


2

There is util called cron. Usually cron handle task scheduling in Linux. But there is also few another ways to do it. In case of cron, you can just run crontab -l to see all task scheduled by current user. If you want to check task for another user use -u $username key TO check root user tasks: sudo crontab -u root -l To understand crontab format please ...


1

The syntax color feature is provided per filestype by the IDE/editor and there's no way to export it or save it as part of the original text file. If your goal is to present the original source with syntax highlighting, I'd suggest to use http://tohtml.com/ and save the rich text preview into a document that supports this format, like ODF text document.


1

First of all, there is some basic concept here: the programs and the source code that you are editing are pure text --- there is no color or style information in the file. It is the editor that decides what color and style to apply when showing it to you. You can easily check that different editors will highlight the structure of your code in different ways. ...


1

I'm assuming it doesn't have to be a command, and giving a totally graphical way to do this. After launching gnome-terminal, the 'file' menu allows you to open new tabs which will have a given title assigned. That can be changed by either the 'terminal' menu or rightclicking the tab and doing it from the context menu. Then you can open top and ...


1

While playing around, I found that it's not the command at all - it's the profile. Go to: Edit | Profiles | (Default) | Edit | Title and Command and change the "When Terminals Set Their Own Title" option to "Keep initial title", at the bottom of the list. Now, when you launch a command with a title, it'll stick around, so your command will work ...


1

As you can see in other answers, the title of the tab is changed by the shell every time it outputs a prompt. And after executing top your tab exits because the command you told it to run finishes... I'll do the following: Step 1: call the terminal with shells, adding environment variables like that: gnome-terminal --tab -t X -e "env MYTAB=X bash" --tab ...


1

The terminal in Ubuntu 14.04 supports profiles. In order to get a transparent terminal follow these steps: Open a terminal Select Profile preferences in the menu Edit Select the Background tab Check the Transparent background radio button Adjust the Shade background or image background slider to your preference You could also select Profiles in the menu ...


1

Not all programs take input. The ls command can take a directory or a file as an argument (e.g. ls /etc) but you can't pipe (|) to it. So, the first command is the same as doing: $ find ~/Downloads -iname *btsync* $ ls -al The pipe is ignored because ls has no way of reading from the standard input. xargs, on the other hand, does something completely ...


1

As a workaround, you can simply redirect the output yourself instead of using the -f option: adb logcat > log I am guessing that the program might change it's working directory so it's trying to create log somewhere where you have no write access. If so, you should also be able to get it to work using an absolute path: adb logcat > ...


1

Put the following scripts in your ~/.bashrc if [ "$(pwd)" == "$HOME/xxx/yyy/zzz/src" ]; then PS1='\u@\h:datasource$ ' else : fi Go to the directory ~/xxx/yyy/zzz/src and to change the prompt . ~/.bashrc In other directory, to get back the original prompt again source your ~/.bashrc. I don't think you need an alias for that. Always you can use ...


1

It's just because you're not running GNOME Shell, I guess that you're running Ubuntu Unity, not the GNOME variant. To record screencast with sound, just install recordMyDesktop: https://apps.ubuntu.com/cat/applications/gtk-recordmydesktop/


1

To sort files by size you can use ls command with -S option: ls -lhS For reverse order, use -r option: ls -lhSr I used also -l option to use a long listing format, and -h option to print sizes in human readable format (e.g., 300KB or 129.1MB or 251MB) See man ls for more info.


1

The following works for gnome3 terminals. It uses xdotool to automate interaction with the gnome terminal menu, since the available keyboard shortcuts are currently limited. I have created two profiles. The top one in the Terminal->Profiles menu is my default, and indicates a local machine. The second one is my color scheme for a remote connection to ...



Only top voted, non community-wiki answers of a minimum length are eligible