35
votes
Opposite of tail: all lines except the last n lines
head file.txt # first 10 lines
tail file.txt # last 10 lines
head -n 20 file.txt # first 20 lines
tail -n 20 file.txt # last 20 lines
head -20 file.txt ...
12
votes
Opposite of tail: all lines except the last n lines
On MAC the solution of getting all lines except the last N lines:
head -n -5 file.txt
will not work, as you will get the following error:
head: illegal line count -- -5
One of the solutions is ...
9
votes
What is a ZFS legacy mount point?
I do not understand the purpose of legacy mount point.
ZFS provides a hierarchical structure of datasets within a pool. In your case you have a pool named rpool, and at least the following datasets:
...
7
votes
Why is my SSH login slow?
I found that PAM was reading the file /var/log/btmp, which had become huge as a result of people trying to brute-force my server. This was leading to login times of a minute. Clearing this file solved ...
6
votes
Accepted
"No version for 'optional' dependency..." when updating Solaris 11.3
It looks like the Oracle docs on Installing Sun Studio missed a step.
To ensure the packages could update, this command needed to be run, which was found under Updating a Package Constrained by an ...
6
votes
Why is my SSH login slow?
I found that restarting systemd-logind.service only cured the problem for a few hours. Changing UsePAM from yes to no in sshd_config has resulted in fast logins, although motd is no longer displayed.
...
5
votes
Replacing /bin/bash with /bin/false in /etc/passwd file
Please be aware that chsh is not always available! in alpine Linux for example or embeded systems using busybox ..
Simple inline sed command :
sed -i '/www-data/s/false/sh/g' /etc/passwd
(This ...
4
votes
Why is my SSH login slow?
Check /etc/resolv.conf on the server to be sure that DNS server, listed in this file, works ok, and delete any non-working DNS.
Sometimes it is very helpful.
4
votes
Why is my SSH login slow?
Note: This started as a "How to debug", tutorial, but ended up being the solution that helped me on an Ubuntu 16.04 LTS server.
TLDR: Run landscape-sysinfo and check if that command takes a ...
4
votes
Accepted
Unix find not working with a wildcard in the path when ssh'ing
Your problem is that the find command does not interpolate/interpret directory glob(s) (the directory list that it must seek under), it only interpolates the pattern as a glob that must match.
What ...
4
votes
Can I virtualize Windows and linux using virtualbox on solaris with zfs zvols?
I am also interested in allowing Windows VMs access to GPU resources. Is this possible in this situation?
To directly passthrough a PCIe graphics card, you will need:
two PCIe graphics cards (one if ...
3
votes
Accepted
Solaris T5120 How to reset firmware root password
This wasn't easy
I spent 2 hours because of vague and bad instructions
Add Jumper to 1 and 2
at the login prompt user : default
It said "Press and release the physical presence button.
Press return ...
3
votes
How can I get numbers of CPU of Sun Solaris by command?
Here is a simple set of pipes using psrinfo:
psrinfo -v | grep ^Status | tail -1 | awk '{x = $5 + 1; print "CPUs: " x;}'
Example output:
CPUs: 6
3
votes
Opposite of tail: all lines except the last n lines
Another way to do it if tail -n won't take negative arguments is
tac file.txt | tail -n +6 | tac
This would remove the last 5 lines
3
votes
CDE-Solaris GTK3 Theme
The closest thing I've seen so far are the Mist themes, except for the purpleness. But maybe there's a version like this.
But the gtk3 version I've found somewhere is kind of buggy, I had to blend ...
3
votes
Accepted
Solaris OS version and Bit
For SunOS 5.7 and later, drop the "5." to get the Solaris version number, so "5.10" is Solaris 10. To see which update release of Solaris 10, you need to look in /etc/release.
To see if it's ...
3
votes
Accepted
Where does Solaris start sshd?
Solaris 10 and later use the Service Management Facility (SMF) to start daemons. SSH is normally started by the SMF service named svc:/network/ssh:default.
Startup scripts are specified in the SMF ...
3
votes
"put -r" in sftp fails with "Invalid flag"
There's no -r flag in OpenSSH sftp put command.
An upload in this client is always recursive.
So use just:
put test/
Or
put test/ /target/directory/
3
votes
Accepted
qemu-system-sparc: shared memory between host and guest
It would appear this is not possible. qemu-system-sparc does not support PCI and the ivshmem devices are emulated as PCI devices. qemu-system-sparc64 on the other hand does support PCI, however it may ...
2
votes
Putty: login, execute command/change environment variable, and do NOT close the session
For those, that cannot modify sshd config for various reasons and/or have +2000 servers (and no access to mass-configuration tools or can't/don't want to change settings for other users), here's a ...
2
votes
How to check services are running or not in Solaris
Unlike on Linux, there's a unified service system on Solaris. It is called SMF. To check if a service is running use the svcs command. svcs -a will give you status of all services configured on the ...
2
votes
Accepted
Solaris T5120 How do i got about installing OS
Use a Cisco console cable connect a PC or other server has 9pin R232 port to the Ser Mgt port
Use a console Terminal like HyperTerminal, set to 9600/8/N/1 to connect to the net management and you can ...
2
votes
How is wget able to download an iso file when only iso.gz is listed under the FTP library
It's likely the server is configured to look for .gz file, when the requested file is not found and return an extracted contents.
With HTTP, it's probably easy to set this up with Apache mod_rewrite ...
2
votes
Accepted
Verify there's enough memory and storage to compile a file?
According to the error message, your system is lacking virtual memory. This can happen even while having enough disk space and enough RAM.
I would start by creating a second zvol, say a 8 GB one, and ...
2
votes
How to add a nameserver to Solaris 11?
The preferred method is to interface with SMF, but you can always cheat...
Populate /etc/resolv.conf & nsswitch & then import into SMF:
nscfg import -fv dns/client
nscfg import -f name-...
2
votes
tar truncating file names when tarfile is transferred from Linux to Unix (Solaris)
Francis's answer regarding issues with interoperability for tar on Solaris and Linux is correct.
You can install gtar (GNU tar) from the sunfreeware site if you can find it – Google "sunfreeware gnu ...
2
votes
Accepted
In VirtualBox what Solaris version to select for installing Solaris 10 1/13?
Updates to Solaris (...) in the past (...) were named after the month and year of their release, such as "Solaris 10 1/13"
Solaris (operating system) - Wikipedia
So you need to set it to Oracle ...
2
votes
Accepted
Jenkins pipeline calls git.exe on non-windows node
In this case the problem was that the jenkins master was installed and is running on windows and there wasn't any git configured for unix(solaris)/linux.
I had to go to Manage Jenkins >> Global ...
2
votes
Solaris 10 3/11 download page shows md5 number of iso image but I don't understand the few extra digits written beside md5 number
It is the file size in bytes. Possibly generated by a specific tool or added by a script.
It is useful to make sure your file is not truncated or incomplete.
2254110720 would be 2,254,110,720 bytes. ...
2
votes
Df -h stuck on solaris. How to stop it?
My guess here is that you are running a version 3 NFS connection and on Solaris 11 you should be running version 4. One of the defects of version 3 was that it would hang the system on something like ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
solaris × 336unix × 81
linux × 70
solaris-10 × 19
bash × 17
zfs × 17
ssh × 16
networking × 14
shell × 14
boot × 12
virtualbox × 11
installation × 11
tar × 11
opensolaris × 11
windows × 10
shell-script × 9
command-line × 8
memory × 7
sed × 7
ksh × 7
ubuntu × 6
virtual-machine × 6
grep × 6
openindiana × 6
hard-drive × 5