Questions tagged [solaris]

Solaris is a Unix operating system originally developed by Sun Microsystems (currently owned by Oracle) as a rebranding of SunOS 4.1.x in 1991.

Filter by
Sorted by
Tagged with
8
votes
3answers
2k views

How to print a line if that line or the next line do not contain a particular string

Input.txt: 8B0C remove 8B0D remove 8B0E remove 8B0F 8B10 remove 8B14 remove 8B15 remove 8B16 remove 8B17 remove 8AC0 8AC1 ...
7
votes
4answers
10k views

Solaris default install (user tools)

Many questions on this forum as well as other places really boils down to somebody coming from Linux environment and then not being able to use the equivalent command on Solaris. Often this is because ...
22
votes
11answers
19k views

Tool in UNIX to subtract dates

Is there any tool in Solaris UNIX (so no GNU tool available) to subtract dates? I know that in Linux we have gawk that can subtract one date from another. But in Solaris the maximum we have is nawk (...
12
votes
3answers
7k views

Creating a UNIX account which only executes one command

Is there a way to create a user account in Solaris which allows the users to run one command only? No login shell or anything else. I could possibly do it with /usr/bin/false in /etc/passwd and just ...
9
votes
2answers
7k views

Remove prefixes from filenames

I have a bunch of files as follows: 04602635_b0294.DAT20120807164534 04602637_b0297.DAT20120807164713 04602638_b0296.DAT20120807164637 04602639_b0299.DAT20120807164819 04602640_b0298....
24
votes
4answers
19k views

Executing user defined function in a find -exec call

I'm on Solaris 10 and I have tested the following with ksh (88), bash (3.00) and zsh (4.2.1). The following code doesn't yield any result: function foo { echo "Hello World" } find somedir -exec ...
3
votes
1answer
3k views

Solaris development host

This posting aims to document how go about getting a development host on Solaris. A "development host" is one where you have all the appropriate tools to build and compile C or C++ applications. ...
3
votes
4answers
459 views

text processing rows to columns for a block

I have a file containing lists on Solaris: List A hi hello hw r u List B Hi Yes List C Hello I need to transpose the lists as shown below: List A List B List C hi Hi Hello ...
22
votes
3answers
96k views

Searching for a string on multiple zip files

I am working on SunOS 5.10. I have a folder that contains about 200 zip files. Each zip file contains only one text file in it. I would like to search for a specific string in all the text files in ...
12
votes
1answer
1k views

POSIX Awk on Solaris 11?

This is more or less a follow up question to the following two: Syntax error removing duplicate lines via awk '!x[$0]++' file awk/nawk alternative on SunOs and Linux I see that on Solaris 10 ...
6
votes
2answers
3k views

What is the TTY major number of your Unix?

I'm currently working on a serial port library which already uses special frameworks to get information about serial ports on the system. Though serial ports are a fundamental design in Unix—as ...
5
votes
2answers
6k views

Arg list too long error while using find

I have the find command as follows: find /jobs/logs/* -prune -name '*.log' -type f -mtime +1 | while read LOGFILE do echo $LOGFILE done This is failing due to the following error:...
2
votes
2answers
29k views

Converting from ascii to utf-8 format - iconv not working [closed]

I have a requirement to convert from ASCII text format to UTF-8. Below is what I am performing through the iconv command: [root@main tmp]# cat File1 1 5 6 [root@main tmp]# file File1 File1: ASCII ...
57
votes
5answers
168k views

How can I get a full process list in solaris, without truncated lines?

Is there a way to generate a full process listing in solaris, without truncated lines? I've tried the ps command, with the following arguments: -f Generates a full listing. (...
42
votes
4answers
7k views

Solaris let me in with different password with the same 8 first characters

I don't know if this is normal, but the thing is, let's say I have a Solaris user called gloaiza and its password is password2getin I'm logging into the server with PuTTY, I just put 192.168.224.100 ...
10
votes
3answers
966 views

How do I less a filename rather than an inode number?

I have a piece of software that rotates its log files when it restarts. However, during development, I am restarting it a lot, so I would like to monitor the latest log file at any time. If I start ...
4
votes
3answers
4k views

How to lock on Solaris 10?

On Linux I use flock lock command to execute a command with an exclusive lock. What is the standard operating system command of Solaris 10 to do the same in a shell?
7
votes
3answers
13k views

How to insert multiple blank lines after every line

I want to insert 5 blank lines after every line in my input file. foo.txt: line 1 line 2 line 3 out.txt: line 1 line 2 line 3 ... Solaris 5.10, nawk or sed.
6
votes
3answers
3k views

update line based on previous line

I have a issue since I'm not familiar with awk. I have csv file generated from sar -d output converted to csv style: 12:33:41 unix,restarts 12:35:00,lofi4096,0,0.0,0,0,0.0,0.0 ,iscsi0,0,0.0,0,...
4
votes
3answers
7k views

How to find the machine from which a user logged into current machine using ssh?

In a multi server architecture, is it possible to find out from which machine a user logged into current machine using ssh? For example, user1 logged into host1. From there, the user logged into ...
-2
votes
3answers
2k views

Replace $ with £ using cat Command

I have file test_output_archive.svd with some Dollar signs ($). I have generated a shell script Replace_dollar_pound.sh with cat command to replace dollar symbol with Pound (£) script is working on ...
7
votes
3answers
26k views

Why `host` and `nslookup` on Solaris 10 resolves hostnames while `ping` and `telnet` does not?

/etc/resolv.conf contains a nameserver that is alive (as reported by the ping command) host or nslookup is able to resolve google.com $ host google.com google.com has address 74.125.228.3 google.com ...
2
votes
1answer
10k views

How do I send all information in /var/adm/message file to a remote system?

I'm trying to figure out how to send all information that is normally identified in the /var/adm/message file on a Solaris system to a remote system.
2
votes
1answer
10k views

Is there any way to check df -k hanging for nfs mount issues?

I am trying to write a script for such failure scenarios. In a scenario where maybe, if remote connection is lost, df waits for the remote server to respond (looks like df is hanging). I know I could ...
1
vote
0answers
535 views

Mailx replace from: address with name

How to replace sender address with his name using mailx command? I was using following command but it was still giving mail address and not name : echo test | mailx -r "Singh,Vivek <vivek.x....
1
vote
2answers
618 views

Change System Language Solaris 8

I have Solaris 8 OS installed in French. Is it possible to switch from French to English without reinstalling the OS ? If yes how ? When locale -a i have this : POSIX common en_US.UTF-8 C ...
1
vote
2answers
140 views

Solaris script - modified date file age

I have a bash script on a Solaris server to provide an alert if a file is in a folder location for longer than 5 minutes. if [ -f $1 ] then a=0 else a=1 However, it is throwing a lot of false ...
1
vote
1answer
251 views

Broadcom driver for Solaris

I just installed Solaris 11.3 on the laptop. This laptop have Broadcom BCM4312 WiFi card. It looks like the install does not have a driver for this card just like 11.1 version. I have a Linux ...
0
votes
1answer
320 views

Putting a piece of code in between two html tags in Solaris [closed]

On a solaris HTML file, how do I insert between an html tag and head tag? through bash scripting. I have an html tag that looks like this: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:arf="...
-1
votes
1answer
2k views

du -sh and df -h are giving different output [duplicate]

I got an alert stating that 3 of my mount points are 91 % full and i need to clear the files. When I run df -h command it states that the mount points are 91% full but when i try to run du -sh * in ...
10
votes
1answer
15k views

Solaris equivalent for depth/prune?

I am trying to find some files inside a directory. By default, the find command is searching the directory which I have specified and it's sub directories. I tried to use depth/maxdepth and prune, ...
20
votes
5answers
25k views

How to get file to a host when all you have is a serial console?

When all you have is a serial console (say via telnet through a terminal server), what methods can be used to transfer files in/out of a host? Cut/paste works for the small/printable stuff and I've ...
4
votes
2answers
15k views

Sed: Replace N first occurrences of a character

I am looking to replace the 5 first occurences of the whitespace character per line inside a sed script. Here's what I have so far sed -e "s/ /;/" -e "s/ /;/" -e "s/ /;/" -e "s/ /;/" -e "s/ /;/" ...
5
votes
2answers
20k views

Is a shell script is a programming Language [closed]

This is the first question in UNIX: I was started shell script from 2 days before. But I have a conflict: is a shell script a special programming language for a specific shell??
8
votes
3answers
3k views

Where is GCC-5 after installing it on Solaris 11?

Please forgive my ignorance... I only use Solaris for testing C/C++ libraries I have an interest in. I'm not a Solaris admin or Solaris user. I installed GCC-5 on Solaris 11.3, x86 because I needed a ...
19
votes
6answers
48k views

Recursive search doesn't work for grep on solaris

On our Solaris server I'm finding that grep -r doesn't work, which is the usual way that I use grep. It seems that egrep has the same behavior. Given that I have no control over the machine, is there ...
10
votes
3answers
20k views

How I can know the IP address of other users logged at the same remote machine?

I can see the names of other users on the remote machine with the who command... I'd also like know the IP address of those users... I was trying with the commands /sbin/ifconfing and netstat but I ...
7
votes
5answers
49k views

Name resolution doesn't work, but nslookup does

I am having a very strange problem with my installation of Solaris 11. DNS resolution just won't work, but strangely enough, nslookup does and connectivity is fine: root@solarisxyz:~# ping ...
5
votes
1answer
3k views

ps command not giving output in home directory

I am logging into a solaris server, switching to bash, then switching to another user "sruser" and switching to bash. /home/batch/sruser/ is the home directory of the user "sruser". The issue is ps ...
13
votes
3answers
2k views

unix - accidentally moved everything under root to /old - Solaris 10

As the headline says everything or almost everything important as root under root (/) was moved to /old on a Solaris 10 machine. So now the typical fault when trying when running commands are Cannot ...
11
votes
5answers
12k views

Is there any alternative to the “sed -i” command in Solaris?

I have a requirement in my project to replace some existing text in a file like foo with some other text like fooofoo: abc.txt name foo foo1 So I tried: sed -i "s/foo/fooofoo/g" abc.txt However I ...
7
votes
5answers
16k views

Difference between “/export/home” and “/home”

In our UNIX machine my home path looks like /home/<userid> and we have another batch user whose home looks like /export/home/<userid> I want to know what's the difference between /export/...
6
votes
1answer
1k views

Ksh loses data after piping 16K bytes

I recently found that ksh may lose some data after printing more than 16K bytes to the stdout if it is blocked for a couple of seconds. This test.sh script prints out 257*64 (16448) bytes: #!/usr/...
6
votes
6answers
28k views

How can i view the contents of a tar.gz file (filenames + filesize)

I cannot use tar -tz as the solaris version I'm using does not accept the -z option. I tried something like gunzip file.tar.gz | tar -tv but that only gives: tar: /dev/rmt/0: No such file or ...
5
votes
1answer
4k views

Obtain device name and mount point if partition label is known

How to obtain the partition device name and mount point when the file system label is known? There are several possibilities: Linux File system label to device name The device name can be obtained ...
3
votes
4answers
2k views

List all open '.log' files in *nix

There are times as a system administrator, you might not be sure of the log file paths of a new application. Depending on the system, there may be multiple ways to find the same. Please share the ...
3
votes
3answers
813 views

Nexenta bash script uses /usr/sun/bin/sed instead of /usr/bin/sed

I'm using a script for Linux and for Solaris (Nexenta). This line works on Linux, but not on solaris (but when run from shell it works): cat "pg_hba.conf" | sed "0,/^local/{s/md5/trust/}" The error ...
2
votes
1answer
3k views

what is inode for, in FreeBSD or Solaris

I know a little about linux kernel. BUt for Freebsd, the "vnode" actually is similar to the "inode" in Linux kernel. And there is a "inode" concept in FreeBSD or Solaris. So my question is: what is "...
2
votes
2answers
2k views

Is there any impact of reaping zombie processes?

I will execute following command for reaping zombie /usr/bin/preap $(ps -ef | grep defunct | grep -v grep | awk '{ print $2 }' | xargs) Is there any service impact of this approach ?
1
vote
1answer
912 views

How do I set Keyboard and profile preferences when connecting to Solaris via SSH?

I'm connecting to a Solaris box from Mac OS X. Whenever I have connected to linux boxes in the past it has been much easier to navigate around. How do I fix these configuration issues on Solaris? ...