Basic UNIX Commands for NetScaler

This article provides basic overview of UNIX commands used on the NetScaler system and basic commands for the vi editor.

Getting to the Shell Command Prompt

To get to the shell, type shell at the NetScaler CLI. To return back to the NetScaler CLI, type exit.

When in the shell, the following tips will help simplify typing and navigation:

  • Use the up or down arrow keys to use previous or next commands.

  • Use the Tab key to auto complete a command or filename.

  • Press the Tab key twice to see the available commands or filenames that match what is typed so far.

  • Use the history command to show all commands that are previously used.

  • Use the exclamation (!) symbol to execute a particular history ID. For example, !362.

Common Commands for Directories

pwd – Shows the current directory.


root@ns# pwd



cd – Changes the directory to a parent directory or a subdirectory.


rooot@ns# cd /var/nstrace/

Changes to the /var/nstrace/ directory from any point because it is explicitly from the /.

root@ns# cd ..

Changes to the parent directory.

root@ns# cd nstrace

Changes directory to nstrace from current directory.

ls – Used for listing content such as files and subdirectories in the current directory.


root@ns# ls –al
– List files, directories and link with the following detail.

root@ns# ls –al

total 643611

drwxr-xr-x 2 root wheel 3072 Feb 15 15:05 .

drwxr-xr-x 29 root wheel 512 Feb 14 2005 ..

-rw-r–r– 1 root wheel 15370 Feb 13 15:05 dmesg.boot

-rw-r–r– 1 root wheel 15370 Feb 13 13:22 dmesg.last

-rw-r–r– 1 root wheel 15374 Feb 9 14:39 dmesg.prev

-rw-r–r– 1 root wheel 98592 Feb 17 10:03 newnslog

-rw-r–r– 1 root wheel 23194 Feb 7 09:29 newnslog.0.gz

-rw-r–r– 1 root wheel 23786 Feb 9 09:30 newnslog.1.gz

-rw-r–r– 1 root wheel 10086 Aug 2 15:53 newnslog.10.gz

permissions, owner, group, size, creation date and file name.

root@ns# ls –ltr – List files, directories sorted by date/time with the latest being the last.


root@ns# ls –ltr

total 643223

-rw-r–r– 1 root wheel 29517 May 2 2005 ns.reboots

-rw-r–r– 1 root wheel 752 May 2 2005 nslog.log

-rw-r–r– 1 root wheel 1702764 Aug 14 2005 newnslog.7.gz

-rw-r–r– 1 root wheel 1126553 Aug 16 2005 newnslog.8.gz

-rw-r–r– 1 root wheel 1191421 Aug 18 2005 newnslog.9.gz

-rw-r–r– 1 root wheel 1003186 Aug 20 15:53 newnslog.10.gz

-rw-r–r– 1 root wheel 1127304 Aug 22 15:53 newnslog.11.gz

-rw-r–r– 1 root wheel 1563115 Aug 24 15:53 newnslog.12.gz

root@ns# cd ../../../opt – Changes to the parent of the parent of the parent and to the opt subdirectory in one command.

root@ns# cd ~ – Changes directory to the users home directory from any where.

date – Used to get the date and time of a UNIX/Linux system.


root@ns# date

Tue Nov 9 12:34:14 EST 2004

ifconfig – Displays the kernel-resident network interfaces.


root@ns# ifconfig –a

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

inet netmask ff000000 hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>mtu 1500 index 2

inet netmask ffff0000 broadcast ether 8:0:20:f9:9:14

ps – Used for listing the process running on the system. ps has many switches –ax will show the most popular information.

Note: The ps command output on NetScaler does not correctly represent the process values. This is normal and great emphasis should not be placed on its output when determining the system status and load.


root@ns# ps -ax

root 0 0 0 Nov 17 ? 0:17 sched
root 1 0 0 Nov 17 ? 0:00 /etc/init –
root 2 0 0 Nov 17 ? 2:47 pageout
root 3 0 0 Nov 17 ? 0:00 fsflush
root 292 1 0 Nov 17 ? 0:00 /usr/lib/saf/sac -t 300
root 219 1 0 Nov 17 ? 0:00 /usr/lib/utmpd

cat – This command is used to display the content of a text file. By default this command gives one full screen of text.


root@ns# cat /etc/hosts localhost fltr-user1-sol1 loghost fltr-user1-1

zcat – This command is used to display the content of a text file that is compressed by gzip that has the “.gz” extension. By default this command gives one full screen of text.


root@ns# gzcat /etc/hosts.gz localhost fltr-user1-sol1 loghost fltr-user1-1

less – This command is used to display the content of a text file and will allow you to scroll backwards and forwards in the file using the arrow keys.

grep – Searches the named input file(s) for lines containing a match to the given pattern.

cat <file> | grep <match>


root@ns# more | grep ctxXtw

# ctxXtw launcher

# See the file ctxXtw.readme.


tail – Displays the last 10 lines of a text file.


root@ns# tail /etc/hosts

root@ns# tail -50 /etc/hosts

You can specify a number of last lines to display by -<num>.

root@ns# tail -f /var/log.file

You can use tail to monitor a text file as it is being modified with the –f.

history – This command lists all shell commands that were previously issued.


root@ns# history

1 netstat –rn

2 exit

3 cd /etc

4 ls

5 cd group

You can use the exclamation (!) symbol with a history ID to issue the command.

Note: For more information, refer to the NetScaler Administrator’s Guide.


  • No Related Posts

Steps to uninstall MAC receiver properly

1.Launch the Terminal app on your Mac by either searching for it in Spotlight or locating it in the Utilities folder under Applications.

2.Type in the following command: “sudo rm -r” (without quotes) and then drag and drop the receiver on the terminal window.

Note : “sudo rm -r” is most powerful command which will delete all the files and directories under the present working directory, please make sure you are executing this command under correct required directory

3.Hit Enter on your keyboard.

4.You may be prompted to enter your OS X user password. Type it in and then hit Enter on your keyboard.

5.All the directories & files would be successfully removed.

6.Install the latest receiver and test.


ShareFile folder activity notifications

Users that have access to folders can also receive email notifications when files are uploaded and downloaded to the account. Users with access to a folder can subscribe to email notifications using the checkbox at the bottom of the folder contents. Applying to subfolders is not available when subscribing to notifications using the checkboxes in this way.

Admin users on a folder can set their own upload and download notifications via the Folder Permissions menu toward the bottom of the page. Using this option, you can use the checkbox shown below to apply your notification settings to any subfolders currently stored within the folder.


ShareFile Folder Invitations

How can I invite users to sign up for access to a folder on my account?

In order to create or edit a Folder Invite, you must have the Admin permission on the folder you wish to link.

  1. Navigate to the folder you wish to invite recipients to
  2. Access the More Options menu beside the folder name.
  3. Click Create (or Edit) Folder Invite.

Customize the options outlined below.

If you lose your link, you can return to it any time using the above steps.

Title – Shown to the client when they receive the invitation.

Description – Note displayed to client when they receive the presentation. This field can be a maximum of 100 characters.

Max Sign-Ups – Maximum number of times a unique client can use the invitation to sign up for an account.

Link Expires In – Duration of time the Folder Invite link is can be used to sign up for an account.

Notify Folder Admins when invitees sign up – Track which users use the links to sign up for an account.

Folder Access Permissions – Permissions the users will have on the folder once they have signed in.

When you click Create Invitation, a link will be displayed. You may copy this link and paste it wherever you need.


If I create a folder invite at a root-level folder, will the user permissions also apply to subfolders in that directory?

Yes. If you do not wish for permissions to be carried into subfolders, you must manage those user permissions on a folder by folder basis.

What will my clients see when they click on the invitation link?

When your clients click on the invitation link, a page will open requesting their name, email address, and company name. If the user has never logged in before, the system will recognize this based on their email address and prompt them to choose a password in a second sign-up screen. If they’re already a user on the account, they will be prompted to enter their ShareFile credentials.

Once the users have signed in, they will be able to see the folder screen with the appropriate permissions.

Can I change the settings on a folder invitation link that I have already sent?

If you would like to edit the settings on an existing invitation link, you can return to it any time using the above steps. under More Options.

The total count of users who have accepted your invitation to access the folder will be listed directly below the Edit Folder Invitation link in the More Options menu. You may also expire the link if it is no longer needed.

Users will not be notified if a Folder Invitation is modified.


Create Folder Links for Sync for Windows

To create a symbolic link between your desired folder and your ShareFile account, you will need to use the Mklink command within Windows Command Prompt. To link your folder, run the Mklink command with the necessary folder information based on the template and example below.

Note: When designating a location in your ShareFile account, add a new folder to the ShareFile file path to correspond with the new linked folder. Ex: C:Users(Your Username)ShareFilePersonal FoldersMy Link Folder


  • Mklink /D <ShareFile Location> <SourceFolder>

Example mklink command:

  • Mklink /D “C:Users(Your Username)ShareFilePersonal FoldersMy Link Folder” “C:Users(Your Username)DesktopMy Link Folder”

Once run successfully, the folder will be created within your Sync location, and the linked folder will be synchronized with ShareFile anytime a new file is uploaded to or downloaded from that folder. The linked folder should show the green Sync overlays for individual files that are synced or syncing.

User-added image
User-added image

User-added image


  1. Windows NTFS file system should be used.
  2. Symbolic links to individual files are not supported
  3. Links work best within the same drive. Links to removable disks and network locations may be removed or disconnected, which can interfere with the link to Sync and cause various issues.
  4. A folder can only be linked in one place within Sync. For example, if the C:UsersUserADocuments is linked to ShareFilePersonal FoldersLink, it cannot also be linked to ShareFileShared FoldersLink.
  5. Renaming of the source folder will break the symbolic link. However, if the source folder is renamed back to its original name, the file may not be uploaded. Sync would require a restart in this case.
  6. You cannot create child links to the source folder you already created. For example, creating 2 links as follows will not work: C:usersuserADocuments and c:usersuserADocumentsFolderA

“Cannot Create a File when that file already exists”

  • This often occurs when the “ShareFile” filepath of your command is pointing to a folder that already exists in ShareFile. Add a folder to the file path, such as “….ShareFilePersonal FoldersLinked Locations


Upgrading from ShareFile Drive Mapper to Citrix Files for Windows

User Settings

Drive Mapper user settings such as Drive Letter is copied into Citrix Files and continue to be enforced.

Group Policy Settings

After upgrading to Citrix Files, Drive Mapper GPO settings will continue to be enforced. If the Citrix Files Group Policy settings are configured, Citrix Files will honor those settings if configured, otherwise it will check if a Drive Mapper GPO setting is configured and enforce it.

User-added image

ShareFile Data Location and Account Sub-directory Mapping

The steps for setting up custom data location and sub-directory paths is slightly different from Drive Mapper to Citrix Files for Windows. In Drive Mapper, there were two GPO settings for custom folder locations:

  • ShareFile Data Location – Local drive or folder path where Drive Mapper stores Folders / Files.
  • Account Sub-directory – Path to the location in ShareFile (such as Shared Folders)

In Citrix Files, the admin can set a custom Mount Point policy as follows:

  • Local Path – specify the local path such as T: or a path c:UsersusernameDocumentsCitrixFiles
  • Citrix Files Path – Path to the location inside ShareFile (such as Shared Folders)

After Upgrade from DriveMapper to Citrix Files, the following conditions could apply:

  1. Citrix File GPO set for Mount Points: Citrix Files mount points will be used and will not check for Drive Mapper GPO policies.
  2. If no GPO is set for Citrix Files or Drive Mapper, Citrix Files will mount the root folder to S: drive (or next available drive letter if S: is already in use)
  3. Only Drive Mapper GPO is set,
    1. ShareFile Data Location and Account Subdirectory GPOs both set: Citrix Files will mount Sub-directory to the Data Location.
    2. Only ShareFile Data Location set: Mount root to the configured Data Location.
    3. Only Account Sub-directory set: Citrix Files will attempt to mount S: to the sub-directory. If S: is not available, Citrix Files does ‘not’ fallback to another drive.

If using Drive Mapper Group Policy definitions, you can recreate similar policy configuration using the Citrix Files Group policy templates. You can learn more about the Group Policy templates from the following article.

The following table describes the mapping between the Drive Mapper policy definition and the Citrix Files policy that will need to be configured to match.

Drive Mapper Policy Setting

Citrix Files Policy Setting

User ConfigurationAdministrative TemplatesShareFile

User ConfigurationAdministrative TemplatesCitrix Files



Account Subdirectory

*use Mount Point configuration under Citrix FilesMount Point 1 – 10

Enable Drive Mapper

Enable Application

Excluded File Extensions

Excluded from Upload

ShareFile Data Location

*use Mount Point configuration under Citrix FilesMount Point 1 – 10

Computer ConfigurationAdministrative TemplatesShareFile

Computer ConfigurationAdministrative TemplatesCitrix Files

Cache Location

Cache Location

Cache Size

Cache Size

Delete Cache

Delete Cache on Exit

Enable Auto-Update

Enable Auto-Update

Enable Connectors

Enable On-Premises Connectors

Enable Drive Mapper

Enable Application

Enable Personal Cloud Connectors

Enable Personal Cloud Connectors


How to Create a Folder and Modify Folder Options

Create a folder to organize the files stored on your account. You have granular control of who can access files stored in a given folder, including the ability to control download and upload permissions.

If you’re looking for information on Folder Options, click here.

Permission Requirements

In order to create a subfolder, you must have upload permissions in the parent folder. To create a folder:

  1. Access the green Action Button and select Create Folder.
  2. Enter a folder name, description (optional) and a drop-down menu to add users.
  3. If you would like to allow other users to access this folder with specific permissions, click the checkbox for Add People to Folder. Leave this box unchecked if you do not wish to add users at this time, or if you plan to add users at a later date.
  4. ShareFile does not allow you to have duplicate folder names on the root of the account or in the same parent folder.
  5. Click Create Folder.
  6. To create a subfolder, repeat the above steps. If you wish to create another folder at the same level as the previous folder, you will need to navigate back to the original folder and repeat these steps.
User-added image

Share Your Folder with Others

Click here for information on how to share your folder with other users.

Create Folders in Bulk

The Bulk Folder Upload is designed for customers who want each of their clients to have their own folder within their account. The Bulk Folder Upload will add your client users to your ShareFile account, provide them with login information, and create folders for each client to access.

Click here to download the Bulk Folder Upload template. Please enter the following information in the provided columns:

  1. EmailAddress
  2. FirstName
  3. LastName
  4. Company
  5. Password (if left blank, the client will receive a randomly generated password)
  6. FolderName

When filling out the spreadsheet do not change the spreadsheet name or any of the column titles. This will cause an error in the upload.

Send the completed spreadsheet to ShareFile Customer Support with the following information:

  • Which root-level folder the new client folders will be created under
  • Who will be the Owner of the new Folders (either you or another Employee)
  • Which permissions and settings the client users should have. These include:
    • Ability to change their passwords
    • Add the user to the company Shared Address Book
    • Users can download from their folders
    • Users can upload from their folders
    • Can delete
    • Users are Folder Administrators
    • Users can receive download notifications
    • Users can receive upload notifications

You will also need to let ShareFile Customer Care know if the Welcome Email should be customized and if you want this sent out to all your new users at one time. Alternatively, you may send out the Welcome Email manually through the Manage Users link in your account.

You may submit the above request directly by clicking here:

Folder Creator vs Folder Owner

When a folder is created by a user, the creator will be listed as the Creator of the folder when viewing the folder as an individual item. Once you have navigated within that folder, you can view the current folder owner in the Folder Access pane at the bottom of the page. If a user created a folder, but has been removed from the account, that user will still be listed as the Folder Creator. However, Folder Owner will be changed when the deleted user’s folders and files have been reassigned to another user.

(The Creator Column denotes the original folder creator)

User-added image

(The current owner of the folder is denoted in the Folder Access pane)

User-added image

Available Folder Options

Folder Options can be accessed in the More Options menu when viewing a folder.

File Retention Policy

The File Retention Policy determines how long files are retained in a specific folder. You can set a default file retention policy for all newly created folders if you are an administrator for the account. To set a policy, click into the root level folder you would like to set the policy on. You have the option to have files deleted 1 day, 7 days, 14 days, 30 days, 60 days, 90 days, 6 months, 1 year or 2 years after they are uploaded.

This applies to all files in the root level folder, as well as all files within the subfolders.

Account-wide default settings can be configured by an account Admin in the Advanced Preferences menu. When changing the account-wide setting, the new setting will only apply to newly created folders and not previous folders in your account.

Will I be notified before my policy deletes my files?

Before files or folders are removed, a warning message is shown in the following locations:

User-added image
User-added image

Retention Policy FAQ

If you set both a folder expiration date and a file retention policy, the most restrictive policy will take effect.

For example, if the folder expiration date is set to one week from today’s date and the file retention policy is set to 30 days then the folders and all its contents will be deleted under the one week policy.

When moving files and folders, they will inherit the new parent/root level folder’s policy.

For example, if you move a file from your File Box into a folder with a retention policy of 90 days, then the file will inherit a expiration date of 90 days from its uploaded date.

When setting a new policy or changing a policy on an existing folder there will be an automatic 7 day warning.

For example, if you uploaded a file six months ago and today set a file retention policy for 30 days, then the file will be set to delete in 7 days to avoid any accidental deletions.

Will the File Retention Policy delete all subfolders?

No – the files contained within the folders will be removed, but the empty folder will remain. To have folders automatically removed, try using a Folder Expiration Date lower down in this article.

What happens to files removed by retention policy?

Files deleted by retention policy stay in recycle bin as per the account policy. It can take up to 48 hours for items to show up in Recycle Bin.

It is possible to customize the retention policy of the Personal Folders section of your account via the Edit Folder Options link. Any changes made to the File Retention policy of your Personal Folders will supersede account-wide File Retention policy settings. If you do not want your users to have this ability, please contact ShareFile Customer Support to have this setting disabled.

Folder Expiration Date

Items deleted via Expiration Policy cannot be restored from the Recycle Bin. To set a specific date on which a folder and all files contained within it are deleted:

  1. Access the folder you wish to delete.
  2. Access More Options beside the folder name and select Advanced Folder Settings.
  3. Under Folder Expiration Date, use the calendar or date format to specify the expiration date.
  4. Save.

Sort Files in a Folder

Files can be sorted by clicking on any header within the folder. The options are by Title, Mb, Uploaded date, or Creator. Folder Admins can change the default sort order in the Advanced Folder Options menu. Account Administrators can set account-wide sorting defaults in the Admin Settings section of their account, in Advanced Preferences.


Download, Send, Rename or Delete a Folder

Download Folder

Right-click the folder and select Download from the drop down menu.

Download Folder Limitations

  • If any file within the folder has a file path longer than 180 characters, you will be unable to download the entire folder. You will need to shorten that file path or navigate further into the folder to download individual files or subfolders.
  • Download speed is determined by your connection speed and the size of the folder being downloaded.

Rename a Folder

You can rename folders and subfolders as needed. This action requires the Admin and Delete permissions on the folder. The original creator or owner of this folder will automatically have the Admin permissions required to rename it.

To rename a folder:

  1. Right-click the folder and select Rename.
  1. Type in the new name in the text box.
  1. Click Save.

Share a Folder

After you have uploaded files to a folder, right-click the folder and select Share. You can share by utilizing Email with ShareFile or Get a Link to send from your email app.

Delete a Folder

To delete a folder, right-click the folder and choose the Delete option.

The Delete Folder option will only be available to the owner of the folder or a member of the Super User Group. For a user without these permissions, the Delete Folder option will simply be absent from the drop-down menu.


Monitor, Read Only and Block a folder, subfolders and files

I need a solution


I need to place some controls in a specific folder along with the other sub-folders and files contained there.

I need to prevent anyone from copying php json and javascript files to a folder named /data/MyFolder/*/*

These are the conditions:

The root user can only have read access to the folder and all the contents inwards and must be registered.

The user user1 may copy any content and must be registered.

Any other user attempting to copy php, json or javascript files should be blocked and register the attempt.

I thank who can help me with the necessary instructions to get it.