UBuntu BASh commands ls - ubuntu-9.10

i want to list files from dev end at tty bettwen 15 and 24...should appears /dev/tty15,/dev/tty16,/dev/tty17, etc until /dev/tty24
what is the command?

If I understand the question correctly, you can use Bash's brace expansion:
ls /dev/tty{15..24}

ls /dev/tty{15..24}?

Related

can't complete Arch Linux installation guide

I'm following arch linux installation guide (this one) step by step, but in some point I can't continue, in this part:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
It can't be done because the file doesn't exist
Any idea?
The command you are talking about is not meant literally.
Region should be replaced with your region.
City should be replaced with the name of a big city inside your region.
Arch Linux does not have a file for every city in the world, but has files for the larger cities. So choose a large city which is close to you.
I live in Vienna, so my command looks like this:
ln -sf /usr/share/zoneinfo/Europe/Vienna /etc/localtime
While you write the command into the shell, you can use tab-completion to see if the region/city you want to choose exists as an Arch-Linux-file/directory.
the command you are using might be old. I just did an arch install and when using your command I received cannot access /etc/localtime no such file for directory.
However, in the /etc/local* I found /etc/locale.gen and it set my timezone when doing the date command to see
so try for example
ln -sf /usr/share/zoneinfo/Canada/Eastern /etc/locale.gen
Are you sure the timezone you are using exists?
The available timezones can be checked using ls /usr/share/zoneinfo/*/*

SSH - Grep with special chars and *

I'm looking to search some files via SSH with the grep command but I have some special chars.
The string I'm looking for is:
"$GLOBALS['....'];"
I tried this one
grep -r -H "\$GLOBALS\\['*'\\]\;" /var/www/
but nothing happens. Any help will be welcome.
Your RE actually matches "$GLOBALS['''''''];" with one or more ' there.
try this one:
grep -rHP "[$]GLOBALS\['.*?']\;" file
I use [$] instead of \$, is because ESCAPE IS SOMEHOW TRICKY, some environment you need use \\\$.
Update, less than 10 chars inside the []:
grep -rHP "[$]GLOBALS\['.{0,10}']\;" file

Screen "Must be connected to a Terminal."

I'm on a Debian OS.
I'm trying to use screen under a SSH session. But when I'm trying to run the command
screen
the shell answer me :
Must be connected to a Terminal.
If I enter
tty
it answer me :
Not a tty
I don't know why and I try
ssh -t login#server
it doesn't work..
Please help me I really need this !
Thanks
EDIT :
I read this topic but it still doesn't work
I had the same problem. If you get this error while in a chroot, here is what helped me:
(run these commands from outside the chroot)
$ sudo mount -o bind /dev /home/chroot/dev
$ sudo mount -t proc proc /home/chroot/proc
$ sudo mount -t devpts devpts /home/chroot/dev/pts
/home/chroot being the path to your chroot, obviously. Update above commands accordingly.
source: http://www.howtoforge.com/forums/showthread.php?t=23583#post128768
(see also http://forums.gentoo.org/viewtopic-t-433006-start-0.html)
Try the following:
getty tty
...and then relaunch:
screen
If you don't have getty, you could try installing it:
apt-get install getty

Viewing more lines with 'rhc tail' and 'rhc-tail-files'

I've deployed a JBoss 7.1 application on OpenShift. Now I have to examine the log file but with the tail -f -n 100 jbossas-7/logs/server.log command I see only the last 10 rows of the log file. There is a way to view whole file? Can I download it?
Thank you!
Edit
Sorry, I haven't explained well. I meant that I wasn't able to view more rows from the rhc-tail-file tool. Sorry! I have solved my problem using ssh client Putty and less command. Thank you for your replies.
You can use the -o option with rhc tail to pass the -n option to tail:
rhc tail <app name> -f jbossas-7/logs/server.log -o '-n100'
Notice, there is no space in '-n100'.
You can use the less or cat command: less jbossas-7/logs/server.log or cat jbossas-7/logs/server.log

Running script in FreeBSD

First steps in FreeBSD: trying to run my installation script. Fast help needed:
# ls
configure
# file configure
configure: Bourne-Again shell script text executable
# ./configure
./configure: Command not found
# configure
configure: Command not found
What is wrong, how can I execute this script?
Do you have bash installed? If not use FreeBSD Ports to install it. Use where bash to find out.
Use the force Luke :)
# pkg_add -r bash
May it be, that your's configure script doesn't have appropriate executions rights. Try to cast:
chmod 777 configure
If it works, fix it to
chmod 764 configure
configure scripts are ultra portable shell scripts. There is no need for bash here. The problem is somewhere else.
What's the first line in the configure script? Maybe a CR/LF snuck in, which is a common cause for a totally misleading error message saying that the script was not found, when it was the interpreter that was not found.
Please try /bin/sh ./configure
Install the bash package using
pkg add bash
or
make -C /usr/ports/shells/bash install clean
By default FreeBSD comes with tcsh and a POSIX compatible FreeBSD sh
On older FreeBSD systems you will need to do
rehash
before you can run it.
First line of this script (#!/usr/bin/bash, i suppose) should be changed to #!/usr/local/bin/bash.
And of course, you should have shells/bash port installed.