Tag Info

New answers tagged

0

@MadMike Thanks. I can see that you have understood the issue already. Hostname got changed successfully. The reason I edited /etc/hosts is to replace the old username in 127.0.1.1 field. I read somewhere that this would do the trick. While the hosts file got updated, it still didn't change what appeared on my terminal. And yes, I would like to change my ...


2

Press Ctrl+U to "cut" the command you were writing (actually, everything that is before the cursor). Then, later, press Ctrl+Y to "paste" that command.


1

If I understand your question correctly, you want the various ways that can list the child processes of a given process. To my knowledge these are: top. Launch top and then press V. From man top: ´V' :Forest-View-Mode toggle In this mode, processes are reordered according to their parents and the layout of the COMMAND column resembles that ...


3

Try htop: sudo apt-get install htop htop It has a tree view (F5) and can show all user and kernel threads (shift+H and shift+K).


0

It's invasive, but you can use the oldest debugging technique in the book: print stuff to mark where things are going wrong: sudo tee -a /etc/profile <<<'echo /etc/profile' sudo tee -a /etc/bash.bashrc <<<'echo /etc/bash.bashrc' tee -a ~/.profile <<<'echo ~/.profile' tee -a ~/.bashrc <<<'echo ~/.bashrc' tee -a ...


1

To find which commands bash runs on start-up and which file those commands came from, run: PS4='+$BASH_SOURCE> ' BASH_XTRACEFD=7 bash -xl 7>&2 The output is lengthy but the source of the gibberish will hopefully be clear. Explanation: PS4='+$BASH_SOURCE> ' When creating an execution trace, bash will prepend every line with an expansion of ...


0

What appears at your command prompt is stored in the variable $PS1. It is generally in the format username@hostname:~$ (depending on your current directory and whether you are root of course). It sounds like your hostname was changed successfully. I'm not sure why you edited your /etc/hosts file but I doubt it would have achieved what you're thinking it ...


1

export PS1='\t$' since i prefer displaying as little background info as possible on the terminal i generally customize every session as a #, $, etc. (if you want to change it permanently, minerz029's solution is perfect) To modify it to show current, I could go for export PS1='\T$' for time in 12 hour format. You can view the bash documentation for ...


1

Basically, I see two possibilities: Samba or NFS. Both are client/server software which means you need to install the client part on your machineA and the server part on your machineB. From that point on, you can get access the files on the server via any software (including terminal) on the client. On the differences, samba is based on the windows ...


8

Press Ctrl + Shift + T This will open a new tab in GNOME Terminal with same directory(PWD) Press Ctrl + Shift + N This will open a new window of GNOME Terminal with same directory(PWD)


1

You can open a second terminal in the same directory using the following command: nohup gnome-terminal --working-directory $PWD >&/dev/null And create an alias to quickly get it: alias dupterm='nohup gnome-terminal --working-directory $PWD >&/dev/null' You can have the same result with the following keyboard shortcut: Ctrl + Shift + n


1

24bit support is enabled by default but gnome-terminal has to be in version linked against libvte >= 0.36 (as stated on the page you mentioned). Which unfortunetly is not the case in the latest ubuntu 14.04 (at the time of writing). As a workaround you may try: sudo add-apt-repository ppa:gnome3-team/gnome3-staging sudo apt-get update sudo apt-get ...


1

I found this worked best for me, I'm on Ubuntu 14.04 LTS First, create a blank file on the desktop, name it Terminal.desktop (or anything-you-want.desktop) Open the file with your preferred text editor (gedit, vim, nano, etc.) and paste/type-out the following: [Desktop Entry] Version=0.99 Name=Terminal Comment=Terminal Desktop Shortcut ...


-1

Kudos to efaj, whose answer got me halfway there. For those who are still stumped, this should get you over the finish line: Create an empty document, probably on the desktop, called something.sh (change the italicized part to whatever you want, but make sure the extension is .sh). Edit the document and enter a series of terminal commands, one on each ...


0

You can install TeamSpeak3 in Ubuntu 14.04 using ppa:logan/arb repository. You dont need to implement difficult compilation methods. sudo add-apt-repository ppa:logan/arb sudo apt-get update sudo apt-get install teamspeak-client


1

Your command-line prompt is defined in the startup script of the shell (bash by default, but YMMV); the default in Ubuntu is to set it to $USER@$HOST, in other words, the user@servername you are looking at. You normally log in to your user on an Ubuntu machine; this user has relatively low privileges --- reading world readable files, reading/writing their ...


0

In Linux, "superuser" privileges give you access to read and write any file on the entire system. You can gain superuser privileges by either logging in as a user called "root", or by using something like sudo. Because it's designed to be able to be used by multiple users, and so no one of those users can mess up the system for everyone else, Linux has ...


1

Yes. Opening a new tab or a new terminal does exactly the same thing: it launches a new instance of your $SHELL (bash by default) in interactive, non-login mode. What this means is that the following files are read: /etc/bash.bashrc ~/.bashrc If you start a login shell, bash will read /etc/profile, and the first of these it finds: /.bash_profile, ...


0

you have 2 ways to do it: you can use one of the real terminal in front end by type ctrl+alt+F1 you can deactivate the action on lid close on power setting. this will allow your laptop to run even the lid is closed


1

Try to override this terminal setting with CCSM (Compiz config settings manager) in opacity, brightness and saturation -> windows specific settings click new and plus button, chose window class and then grab button click on open terminal window and set value e.g 75 for opacity.


1

If you want to gain ownership of a drive you can use the chown command: sudo chown -R username:username /media/username/nameofdrive This gives the user ownership over the drive without allowing permission to unauthorized users and "-R" makes this command recursive so that ownership also applies to all of the existing individual files on the drive as well ...


0

The drives will be located in /media/username folder. Goto that directory using cd command. And then on terminal sudo chmod 777 nameofdrive 777 assigns read,write and execute permissions to all users.


1

it's called gnome-terminal. Each terminal it's an instance, then have it own process. But the tab's of one terminal are linked. If you kill the process ( sudo killall gnome-terminal ) all the tab's will be closed.


1

It's called bash. Each running terminal does have a separate process.


0

I've just noticed that my original solution has been already rejected in the question. While there seems no simple way to change the profile, you can change background / foreground color by using setterm command. So, this setterm -term linux -background black -foreground green would give you black background with green text. The only problem is that ls has ...


5

To extend Sylvain's answer, some helper functions: bold() { ansi 1 "$@"; } italic() { ansi 3 "$@"; } underline() { ansi 4 "$@"; } strikethrough() { ansi 9 "$@"; } red() { ansi 31 "$@"; } ansi() { echo -e "\e[${1}m${*:2}\e[0m"; } Then


9

The ANSI/VT100 terminals and terminal emulators are not just able to display black and white text; they can display colors and formatted texts thanks to escape sequences. Those sequences are composed of the Escape character (often represented by "^[" or "Esc") followed by some other characters: "Esc[FormatCodem". In Bash, the character can be ...


0

Best solution: I found a very interesting command stty. From man stty: stty - change and print terminal line settings. In tty1 I ran this: sudo stty rows 20. Now my tty screen is limited to 20 rows, which allows for 20 rows on the screen. It works with sudo apt-get install libreoffice -s, and any other command. Now, it doesn't seem to work with ...


1

A little improvement to the existed script which also checks xdotool installed on system and adds variable for changing path #!/bin/bash SAVEPATH=/tmp/termprofile if [ ! -f /usr/bin/xdotool ]; then echo "please install 'xdotool'" exit 1 fi gnome-terminal --save-config=$SAVEPATH LINES=($(grep -n '\[Terminal' $SAVEPATH | cut -d: -f1)) for ...


1

Use the ↑ key Use the reverse search integrated in the terminal by pressing ctrl and r Use a bin file open gedit by typing gedit in the dash enter #/bin/bash in the first row now enter each command in a new line save it in /home/[username]/bin/ without an ending (gedit does it automatically right) go into nautilus (the data explorer) and right click the ...


1

I preserve previous answer for myself, and add one more depending on our discussion. This is not perfect solution, but I think we can improve it together: #!/bin/bash new_line(){ echo -e ""; } n=0 # line counter H=$(stty size | cut -d" " -f1) # this is height of current terminal # uncomment next line if you want to add empty line after (height - 1) ...


0

If you want exactly blank line try this: Open terminal and create this two functions, then execute trap: $ preexec () { echo -e ""; } $ preexec_invoke_exec () { [ -n "$COMP_LINE" ] && return # do nothing if completing preexec } $ trap 'preexec_invoke_exec' DEBUG Now try to execute any command and see results Be sure that help trap says: ...


1

I'd suggested the following as a way to keep the shell open: gnome-terminal -x sudo -u userA bash -c 'PACKAGE_PATH=/home/userA/package1:/home/userA/package2:$PACKAGE_PATH; \ cd /home/userA/scripts; \ source varset.sh; \ bash' However, the last bash won't be affected by the assignment of $PACKAGE_PATH or from source varset.sh if they aren't exported. ...


0

Screen or Byobu are my preferred methods of managing complex workflow in the terminal, and both allow saving your configurations.


2

You can access it via /media/[username]/[crazy characters] [username] is your username logged in [crazy characters] is random things, mine was "7856-2D7D"


2

By default, when you choose the option to "run in a terminal window", the (gnome-) terminal window closes after it is finished. It does open, since you mention it opens for a second. You can make it stay open by changing the setting it in your terminal profile: From the (gnome-terminal) menu, choose "Edit" > "Profile Settings" > "Title and Command". In the ...


2

You probably want to use gksudo if you want to start it from your Desktop. That will open a window asking you for your password. #!/bin/bash gksudo -u userA bash -c 'PACKAGE_PATH=/home/userA/package1; cd /home/userA/scripts' Also to debug, you probably want to run that script in your terminal first. That way it will not close just after printing some ...


1

You'll have to use sudo somewhere. Lets use them in the scripts: #! /bin/bash #userA.sh sudo -u userA bash -c '/path/to/script1.sh; /path/to/script2.sh; ... \ /path/to/scriptn.sh; Similarly for userB. Consider creating a .desktop file for both scripts, or making them run on double click. Then consider giving yourself password-less perissions for ...



Top 50 recent answers are included